1.0.1 • Published 7 years ago

@michgonch/sure v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

npm (scoped) npm bundle size

Sure

Implementing Thenable.

Install

npm install @michgonch/sure

Usage

const Sure = require("./sure");

new Sure(resolve => {
  setTimeout(() => {
    resolve(`Hello, Promise!`);
  }, 1000);
}).then(msg => console.log(msg));

(async () => {
  const msg = await new Sure(resolve => {
    setTimeout(() => {
      resolve(`Hello, Async!`);
    }, 2000);
  });

  console.log(msg);
})();

Inspiration

How to make a beautiful, tiny npm package and publish it

Write Your Own Node.js Promise Library from Scratch

License

MIT.

1.0.1

7 years ago

0.1.0

7 years ago