universalify

Make a callback- or promise-based function support both promises and callbacks.

MIT License

Downloads
343.1M
Stars
108
Committers
5
universalify - v2.0.1 Latest Release

Published by RyanZim 12 months ago

  • Performance improvements (thanks @H4ad!)
universalify - v2.0.0

Published by RyanZim over 4 years ago

  • Properly handle falsy errors (#13). This is technically a BREAKING CHANGE, but will not affect the vast majority of users.
  • Performance improvements for fromCallback (#12).

Thanks to @joepie91 for submitting the fixes for this release!

universalify - v1.0.0

Published by RyanZim over 4 years ago

  • BREAKING: Drop support for Node versions 4, 6, & 8
  • Modernize code
universalify - v0.2.0

Published by RyanZim over 4 years ago

Bugfix

Do not pass callback to promise functions; to prevent breaking functions with optional parameters.

universalify - v0.1.2

Published by RyanZim over 6 years ago

Add engines field to package.json

universalify - v0.1.1

Published by RyanZim over 7 years ago

Bugfix

Previously, if you universalify.fromPromise()ed a function, and called it with a callback that contained an error (as is common with mocha tests), universalify would call the callback again with the error when the callback threw.

Now errors will cause an unhandled promise rejection (which is OK, because normally a callback error causes an unhandled rejection).

universalify - v0.1.0

Published by RyanZim over 7 years ago

universalified functions now have their name attribute preserved