fulfiller
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

fulfiller

Build Status David npm

$ npm install fulfiller

Utility that makes a function return a Promise. If no function is provided it always returns a resolved Promise.

import fulfiller from 'fulfiller';

(async () => {
  const fn = (msg: string) => msg;
  const fnPromised = fulfiller(fn);
  const result = await fnPromised('hello');
  console.log(result); // 'hello'
})();

Readme

Keywords

none

Package Sidebar

Install

npm i fulfiller

Weekly Downloads

1

Version

0.2.2

License

MIT

Last publish

Collaborators

  • gagle