@michgonch/sure
v1.0.1
Published
Etude on Promise implementation, bundled with Rollup and published to NPM.
Downloads
1
Readme
Sure
Implementing Thenable.
Install
npm install @michgonch/sureUsage
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.
