{"_id":"promise-now","_rev":"59-affe5f66dcc11835dcc10627e08ed889","name":"promise-now","description":"Barebone Promise/A+ implementation","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.0":{"name":"promise-now","version":"0.1.0","description":"Barebone Promise/A+ implementation","main":"lib/Promise.js","directories":{"lib":"lib","test":"test"},"devDependencies":{"promises-aplus-tests":"*","mocha":"1.x","uglify-js":"2.x","browserify":"2.x"},"scripts":{"prepublish":"make","test":"mocha test/composer.js && promises-aplus-tests test/promise.js"},"repository":{"type":"git","url":"https://github.com/curvedmark/promise-now.git"},"keywords":["promise","promises","promises-a","promises-aplus","async","deferred","future","flow control"],"author":{"name":"Glen Huang","email":"curvedmark@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/curvedmark/promise-now/issues"},"readme":"# Promise Now\n\nBarebone [Promise/A+](http://promisesaplus.com/) implementation. `.then()` being asynchronous is optional.\n\n## Installation\n\n\tnpm install promise-now\n\n## Example\n\n```javascript\nvar Promise = require('promise-now');\nvar promise = new Promise();\n\npromise.then(addOne).then(addOne).then(function(num) {\n\tconsole.log(num); // 3\n});\npromise.fulfill(1);\n\nfunction addOne(num) {\n\treturn num + 1;\n}\n```\n\n## API\n\n```javascript\npromise.then(fulfullCallack, rejectCallback);\n```\n\nSee the [Q tutorial](https://github.com/kriskowal/q#tutorial), if you are not familiar with promises.\n\n```javascript\npromise.fulfill(value);\n```\n\nFullfil `promise` with `value`. This method only exists on the promises created by `new Promise()`, not on promises returned by `.then()`.\n\nReturns `promise`.\n\n```javascript\npromise.reject(reason);\n```\n\nReject `promise` with `reason`. This method only exists on the promises created by `new Promise()`, not on promises returned by `.then()`.\n\nReturns `promise`.\n\n## Optionally being asynchonous\n\nIf you can be sure that you will never write code like:\n\n```javascript\nvar promise = new Promise().fulfill();\n\npromise.then(function() {\n\tconsole.log(2);\n});\nconsole.log(1);\n```\n\nIn other words, you will not put synchronous code after asynchronous function calls, it doesn't make a difference if `.then()` is asynchronous or not.\n\nBy default, promise-now use synchronous `.then()`. If you need the asynchronous version, consider using another promise library, or patch promise-now youself (see `test/promise.js` on how it's done).","readmeFilename":"README.md","_id":"promise-now@0.1.0","dist":{"shasum":"dfe97b5a2de159886d368e7d3d970ab4bc008812","tarball":"https://registry.npmjs.org/promise-now/-/promise-now-0.1.0.tgz","integrity":"sha512-uuE7/Rc9CoGjLPwgPKtRXJS+oHRlU1l4iBs2geXTEc6DnAAAxo2imtZTyst3K+dny2QP5ZzogvLF5BGHywlr0g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGTvF2nx7Qfigjm63XhszAq8OKa0BcWIWoZds8MEj4vWAiEAlnB/QdbMECuXy0DScuvcbg2wRa2S7HaULbKC4RB/hQA="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"curvedmark","email":"curvedmark@gmail.com"},"maintainers":[{"name":"curvedmark","email":"curvedmark@gmail.com"}]},"0.2.0":{"name":"promise-now","version":"0.2.0","description":"Barebone Promise/A+ implementation","main":"lib/Promise.js","directories":{"lib":"lib","test":"test"},"devDependencies":{"promises-aplus-tests":"*","mocha":"1.x","uglify-js":"2.x","browserify":"2.x"},"scripts":{"prepublish":"make","test":"mocha test/composer.js && promises-aplus-tests test/promise.js && mocha test/promiseSync.js"},"repository":{"type":"git","url":"https://github.com/curvedmark/promise-now.git"},"keywords":["promise","promises","promises-a","promises-aplus","async","deferred","future","flow control"],"author":{"name":"Glen Huang","email":"curvedmark@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/curvedmark/promise-now/issues"},"readme":"# Promise Now\n\nBarebone [Promise/A+](http://promisesaplus.com/) implementation. `.then()` being asynchronous is optional.\n\n## Installation\n\n\tnpm install promise-now\n\n## Example\n\n```javascript\nvar Promise = require('promise-now');\nvar promise = new Promise();\n\npromise.then(addOne).then(addOne).then(function(num) {\n\tconsole.log(num); // 3\n});\npromise.fulfill(1);\n\nfunction addOne(num) {\n\treturn num + 1;\n}\n```\n\n## API\n\n```javascript\npromise.then(fulfullCallack, rejectCallback);\n```\n\nSee the [Q tutorial](https://github.com/kriskowal/q#tutorial), if you are not familiar with promises.\n\n```javascript\npromise.fulfill(value);\n```\n\nFullfil `promise` with `value`. This method only exists on the promises created by `new Promise()`, not on promises returned by `.then()`.\n\nReturns `promise`.\n\n```javascript\npromise.reject(reason);\n```\n\nReject `promise` with `reason`. This method only exists on the promises created by `new Promise()`, not on promises returned by `.then()`.\n\nReturns `promise`.\n\n## Optionally being asynchonous\n\nIf you can be sure that you will never write code like:\n\n```javascript\nvar promise = new Promise().fulfill();\n\npromise.then(function() {\n\tconsole.log(2);\n});\nconsole.log(1);\n```\n\nIn other words, you will not put synchronous code after asynchronous function calls, it doesn't make a difference if `.then()` is asynchronous or not.\n\nBy default, promise-now use synchronous `.then()`. If you need the asynchronous version, consider using another promise library, or patch promise-now youself (see `test/promise.js` on how it's done).","readmeFilename":"README.md","_id":"promise-now@0.2.0","dist":{"shasum":"19f95a5b45f3b1e0e0807a41dd1ff2a0ba98c158","tarball":"https://registry.npmjs.org/promise-now/-/promise-now-0.2.0.tgz","integrity":"sha512-6iRGgekLg7uBYfnC0qAl7EskZYYz5Lg8MRLOfsk5qAiYsEVsgE4l98/DV+JXRb1X7jGI6c1pvlIzD5bCkJR6Rw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC2pQ8y07OrJ8/akG8iXn/MiCZoyLa04UgRpq7Sf7F9eAiAZ8T8vcbS2kCC1Er/SN3UMAmPWsp5Kc2riV+2WDffdvg=="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"curvedmark","email":"curvedmark@gmail.com"},"maintainers":[{"name":"curvedmark","email":"curvedmark@gmail.com"}]},"0.2.1":{"name":"promise-now","version":"0.2.1","description":"Barebone Promise/A+ implementation","main":"lib/Promise.js","directories":{"lib":"lib","test":"test"},"devDependencies":{"promises-aplus-tests":"*","mocha":"1.x","uglify-js":"2.x"},"scripts":{"prepublish":"make","test":"mocha test/composer.js && promises-aplus-tests test/promise.js && mocha test/promiseSync.js"},"repository":{"type":"git","url":"https://github.com/curvedmark/promise-now.git"},"keywords":["promise","promises","promises-a","promises-aplus","async","deferred","future","flow control"],"author":{"name":"Glen Huang","email":"curvedmark@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/curvedmark/promise-now/issues"},"readme":"# Promise Now\n\nBarebone [Promise/A+](http://promisesaplus.com/) implementation. `.then()` being asynchronous is optional.\n\n## Installation\n\n\tnpm install promise-now\n\n## Example\n\n```javascript\nvar Promise = require('promise-now');\nvar promise = new Promise();\n\npromise.then(addOne).then(addOne).then(function(num) {\n\tconsole.log(num); // 3\n});\npromise.fulfill(1);\n\nfunction addOne(num) {\n\treturn num + 1;\n}\n```\n\n## API\n\n```javascript\npromise.then(fulfullCallack, rejectCallback);\n```\n\nSee the [Q tutorial](https://github.com/kriskowal/q#tutorial), if you are not familiar with promises.\n\n```javascript\npromise.fulfill(value);\n```\n\nFullfil `promise` with `value`. This method only exists on the promises created by `new Promise()`, not on promises returned by `.then()`.\n\nReturns `promise`.\n\n```javascript\npromise.reject(reason);\n```\n\nReject `promise` with `reason`. This method only exists on the promises created by `new Promise()`, not on promises returned by `.then()`.\n\nReturns `promise`.\n\n## Optionally being asynchonous\n\nIf you can be sure that you will never write code like:\n\n```javascript\nvar promise = new Promise().fulfill();\n\npromise.then(function() {\n\tconsole.log(2);\n});\nconsole.log(1);\n```\n\nIn other words, you will not put synchronous code after asynchronous function calls, it doesn't make a difference if `.then()` is asynchronous or not.\n\nBy default, promise-now use synchronous `.then()`. If you need the asynchronous version, consider using another promise library, or patch promise-now youself (see `test/promise.js` on how it's done).","readmeFilename":"README.md","_id":"promise-now@0.2.1","dist":{"shasum":"db7765e51d3be934c6315c35900c3fbdaf4ed7ca","tarball":"https://registry.npmjs.org/promise-now/-/promise-now-0.2.1.tgz","integrity":"sha512-7ZCGh/oXolRVlvHiK9S/nmlSV3a0l5FsYQsFuEZkq8x1RyELtlU8B26Fcn8lukQvZRvptiBnMVv8JhLCBS+Qjw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrn2CR/ICBrUiKb4mnsB/iZwabGimFb9wvjTm8bGXw/QIhANQ5JV8kH6J7oxD4IkpQlxhulr6WYeGboNDoWwHtoafG"}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"curvedmark","email":"curvedmark@gmail.com"},"maintainers":[{"name":"curvedmark","email":"curvedmark@gmail.com"}]},"0.2.2":{"name":"promise-now","version":"0.2.2","description":"Barebone Promise/A+ implementation","main":"Promise.js","directories":{"test":"test"},"dependencies":{"compo":"*"},"devDependencies":{"promises-aplus-tests":"*","mocha":"1.x","uglify-js":"2.x"},"scripts":{"test":"promises-aplus-tests test/promise.js && mocha test/promiseSync.js"},"repository":{"type":"git","url":"https://github.com/curvedmark/promise-now.git"},"keywords":["promise","promises","promises-a","promises-aplus","async","deferred","future","flow control"],"author":{"name":"Glen Huang","email":"curvedmark@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/curvedmark/promise-now/issues"},"readme":"# Promise Now\n\nBarebone [Promise/A+](http://promisesaplus.com/) implementation. `.then()` being asynchronous is optional.\n\n## Installation\n\n\tnpm install promise-now\n\n## Example\n\n```javascript\nvar Promise = require('promise-now');\nvar promise = new Promise();\n\npromise.then(addOne).then(addOne).then(function(num) {\n\tconsole.log(num); // 3\n});\npromise.fulfill(1);\n\nfunction addOne(num) {\n\treturn num + 1;\n}\n```\n\n## API\n\n```javascript\npromise.then(fulfullCallack, rejectCallback);\n```\n\nSee the [Q tutorial](https://github.com/kriskowal/q#tutorial), if you are not familiar with promises.\n\n```javascript\npromise.fulfill(value);\n```\n\nFullfil `promise` with `value`. This method only exists on the promises created by `new Promise()`, not on promises returned by `.then()`.\n\nReturns `promise`.\n\n```javascript\npromise.reject(reason);\n```\n\nReject `promise` with `reason`. This method only exists on the promises created by `new Promise()`, not on promises returned by `.then()`.\n\nReturns `promise`.\n\n## Optionally being asynchonous\n\nIf you can be sure that you will never write code like:\n\n```javascript\nvar promise = new Promise().fulfill();\n\npromise.then(function() {\n\tconsole.log(2);\n});\nconsole.log(1);\n```\n\nIn other words, you will not put synchronous code after asynchronous function calls, it doesn't make a difference if `.then()` is asynchronous or not.\n\nBy default, promise-now use synchronous `.then()`. If you need the asynchronous version, consider using another promise library, or patch promise-now youself (see `test/promise.js` on how it's done).","readmeFilename":"README.md","_id":"promise-now@0.2.2","dist":{"shasum":"64c2ef30281b7a16cbfb6875d9fb584c11d497d5","tarball":"https://registry.npmjs.org/promise-now/-/promise-now-0.2.2.tgz","integrity":"sha512-xZYgcdzAmPGuXq+7ia++Ch+ssR5ZJFdt14yZ1QGz26eJPodKhUhPUExD164y+dim/7elimRQlqIGy8UqfEv7cQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZu3a1nNHxcrXDopGjPd+cDV7oJHDyrup94+EecAXPZQIgBt2uvxtb4y+SSQ/EU0Di3s5sIlx/KCxXj2qIYaAb8GM="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"curvedmark","email":"curvedmark@gmail.com"},"maintainers":[{"name":"curvedmark","email":"curvedmark@gmail.com"}]},"0.3.0":{"name":"promise-now","version":"0.3.0","description":"Barebone Promise/A+ implementation","main":"Promise.js","directories":{"test":"test"},"dependencies":{"compo":"*"},"devDependencies":{"promises-aplus-tests":"*","mocha":"1.x","uglify-js":"2.x"},"scripts":{"test":"promises-aplus-tests test/promise.js --bail --reporter dot && mocha test/promiseSync.js"},"repository":{"type":"git","url":"https://github.com/curvedmark/promise-now.git"},"keywords":["promise","promises","promises-a","promises-aplus","async","deferred","future","flow control"],"author":{"name":"Glen Huang","email":"curvedmark@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/curvedmark/promise-now/issues"},"readme":"# Promise Now\n\nBarebone [Promise/A+](http://promisesaplus.com/) implementation. `.then()` being asynchronous is optional.\n\n## Installation\n\n\tnpm install promise-now\n\n## Example\n\n```javascript\nvar Promise = require('promise-now');\nvar promise = new Promise();\n\npromise.then(addOne).then(addOne).then(function(num) {\n\tconsole.log(num); // 3\n});\npromise.fulfill(1);\n\nfunction addOne(num) {\n\treturn num + 1;\n}\n```\n\n## API\n\n```javascript\npromise.then(fulfullCallack, rejectCallback);\n```\n\nSee the [Q tutorial](https://github.com/kriskowal/q#tutorial), if you are not familiar with promises.\n\n```javascript\npromise.fulfill(value);\n```\n\nFullfil `promise` with `value`. This method only exists on the promises created by `new Promise()`, not on promises returned by `.then()`.\n\nReturns `promise`.\n\n```javascript\npromise.reject(reason);\n```\n\nReject `promise` with `reason`. This method only exists on the promises created by `new Promise()`, not on promises returned by `.then()`.\n\nReturns `promise`.\n\n## Optionally being asynchonous\n\nIf you can be sure that you will never write code like:\n\n```javascript\nvar promise = new Promise().fulfill();\n\npromise.then(function() {\n\tconsole.log(2);\n});\nconsole.log(1);\n```\n\nIn other words, you will not put synchronous code after asynchronous function calls, it doesn't make a difference if `.then()` is asynchronous or not.\n\nBy default, promise-now use synchronous `.then()`. If you need the asynchronous version, consider using another promise library, or patch promise-now youself (see `test/promise.js` on how it's done).","readmeFilename":"README.md","_id":"promise-now@0.3.0","dist":{"shasum":"c8e7fccb383804d75ec705aca82a0969a28470b5","tarball":"https://registry.npmjs.org/promise-now/-/promise-now-0.3.0.tgz","integrity":"sha512-YCTbR64Qa5iBTukE4nCDLf0OyVOgjVEgnFIkPmoqrW/HKG/2zkwEAF9N+a7nXauBPo5Xn6rlKC6GGexvKoCBiQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICiz8v6d1Ubp2lHc/4A6I7Dw3TU822izqXc43+vphkB/AiEAlYF5hS0iAmED8ITBr62Zx01B0919f8suVsFcBpvRZwE="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"curvedmark","email":"curvedmark@gmail.com"},"maintainers":[{"name":"curvedmark","email":"curvedmark@gmail.com"}]},"0.4.0":{"name":"promise-now","version":"0.4.0","description":"Barebone Promise/A+ implementation","main":"Promise.js","directories":{"test":"test"},"devDependencies":{"promises-aplus-tests":"*","mocha":"1.x","uglify-js":"2.x"},"scripts":{"test":"promises-aplus-tests test/promise.js --bail --reporter dot && mocha test/promiseSync.js"},"repository":{"type":"git","url":"https://github.com/curvedmark/promise-now.git"},"keywords":["promise","promises","promises-a","promises-aplus","async","deferred","future","flow control"],"author":{"name":"Glen Huang","email":"curvedmark@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/curvedmark/promise-now/issues"},"readme":"# Promise Now\n\nBarebone [Promise/A+](http://promisesaplus.com/) implementation. `.then()` being asynchronous is optional.\n\n## Installation\n\n\tnpm install promise-now\n\n## Example\n\n```javascript\nvar Promise = require('promise-now');\nvar promise = new Promise();\n\npromise.then(addOne).then(addOne).then(function(num) {\n\tconsole.log(num); // 3\n});\npromise.fulfill(1);\n\nfunction addOne(num) {\n\treturn num + 1;\n}\n```\n\n## API\n\n```javascript\npromise.then(fulfullCallack, rejectCallback);\n```\n\nSee the [Q tutorial](https://github.com/kriskowal/q#tutorial), if you are not familiar with promises.\n\n```javascript\npromise.fulfill(value);\n```\n\nFullfil `promise` with `value`. Returns `promise`.\n\n```javascript\npromise.reject(reason);\n```\n\nReject `promise` with `reason`. Returns `promise`.\n\n## Optionally being asynchonous\n\nIf you can be sure that you will never write code like:\n\n```javascript\nvar promise = new Promise().fulfill();\n\npromise.then(function() {\n\tconsole.log(2);\n});\nconsole.log(1);\n```\n\nIn other words, you will not put synchronous code after asynchronous function calls, it doesn't make a difference if `.then()` is asynchronous or not.\n\nBy default, promise-now use synchronous `.then()`. If you need the asynchronous version, simply patch promise-now (see `test/promise.js` on how it's done).","readmeFilename":"README.md","_id":"promise-now@0.4.0","dist":{"shasum":"9712d94c1053d0341daf1e52530f7a8ebd5e09c2","tarball":"https://registry.npmjs.org/promise-now/-/promise-now-0.4.0.tgz","integrity":"sha512-dUDliui2rLCyBx38Vr9fJWbgmh9yLYB0wzs4U989ELzjEdVZp3Lh2NlC3Gi8/aJJP578xZDIugICAIuCwhq2yw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICfxhHJkq0IlY7f1RpHV8378HE9iuwkmUDraTbEUTuueAiB/9PBK6n5OdLlXNTGHQGnP1Tq26Pq/b0h06jY30wPr7g=="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"curvedmark","email":"curvedmark@gmail.com"},"maintainers":[{"name":"curvedmark","email":"curvedmark@gmail.com"}]},"0.4.1":{"name":"promise-now","version":"0.4.1","description":"Barebone Promise/A+ implementation","main":"Promise.js","directories":{"test":"test"},"devDependencies":{"promises-aplus-tests":"*","mocha":"1.x","uglify-js":"2.x"},"scripts":{"test":"promises-aplus-tests test/promise.js --bail --reporter dot && mocha test/promiseSync.js"},"repository":{"type":"git","url":"https://github.com/curvedmark/promise-now.git"},"keywords":["promise","promises","promises-a","promises-aplus","async","deferred","future","flow control"],"author":{"name":"Glen Huang","email":"curvedmark@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/curvedmark/promise-now/issues"},"readme":"# promise-now\n\nBarebone [Promise/A+](http://promisesaplus.com/) implementation.\n\n## Features\n\n- Extremely small (< 1kb minified), [extremely fast](http://jsperf.com/wqfwewefewrw/17)\n\n- `.then()` being asynchronous is optional.\n\n- Passing the [Promises/A+ Compliance Test Suite](https://github.com/promises-aplus/promises-tests)\n\n## Installation\n\n\tnpm install promise-now\n\n## Example\n\n```javascript\nvar Promise = require('promise-now');\nvar promise = new Promise();\n\npromise.then(addOne).then(addOne).then(function(num) {\n\tconsole.log(num); // 3\n});\npromise.fulfill(1);\n\nfunction addOne(num) {\n\treturn num + 1;\n}\n```\n\n## API\n\n```javascript\npromise.then(fulfullCallack, rejectCallback);\n```\n\nSee the [Q tutorial](https://github.com/kriskowal/q#tutorial), if you are not familiar with promises.\n\n```javascript\npromise.fulfill(value);\n```\n\nFullfil `promise` with `value`. Returns `promise`.\n\n```javascript\npromise.reject(reason);\n```\n\nReject `promise` with `reason`. Returns `promise`.\n\n## `.then()` being asynchonous\n\nIf you can be sure that you will never write code like:\n\n```javascript\nvar promise = new Promise().fulfill();\n\npromise.then(function() {\n\tconsole.log(2);\n});\nconsole.log(1);\n```\n\nIn other words, you will not put synchronous code after asynchronous function calls, then it doesn't make a difference if `.then()` is asynchronous or not.\n\nBy default, promise-now use synchronous `.then()`. If you need the asynchronous version, simply patch promise-now (see `test/promise.js` on how it's done).","readmeFilename":"README.md","_id":"promise-now@0.4.1","dist":{"shasum":"3546a7baf9dc1deb134df45b5b6443dc974d2a20","tarball":"https://registry.npmjs.org/promise-now/-/promise-now-0.4.1.tgz","integrity":"sha512-7w8VoMeCIVOKK4Y75kpS+spNYUV9LLFFaIk+0Q2V4cOVRXOKmGRf7B7CCE6IXoSV27ytmz23uyqog178ge4RSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvKdiEI6FqnC2B45xBp3S2m9Jp8/99PLaQglqwT9UuhwIgTFL0BuaOiGj4CVIsU8DVh8oVt6zbWOS7U9xCfUlcFXo="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"curvedmark","email":"curvedmark@gmail.com"},"maintainers":[{"name":"curvedmark","email":"curvedmark@gmail.com"}]},"0.5.1":{"name":"promise-now","version":"0.5.1","description":"Barebone Promise/A+ implementation","main":"Promise.js","directories":{"test":"test"},"devDependencies":{"promises-aplus-tests":"*","mocha":"1.x","uglify-js":"2.x"},"scripts":{"test":"promises-aplus-tests test/promise.js --bail --reporter dot && mocha test/promiseSync.js"},"repository":{"type":"git","url":"https://github.com/curvedmark/promise-now.git"},"keywords":["promise","promises","promises-a","promises-aplus","async","deferred","future","flow control"],"author":{"name":"Glen Huang","email":"curvedmark@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/curvedmark/promise-now/issues"},"readme":"# promise-now\n\nBarebone [Promise/A+](http://promisesaplus.com/) implementation.\n\n## Features\n\n- Extremely small (~ 1kb minified), [extremely fast](http://jsperf.com/wqfwewefewrw/17)\n\n- `.then()` being asynchronous is optional.\n\n- Passing the [Promises/A+ Compliance Test Suite](https://github.com/promises-aplus/promises-tests)\n\n## Installation\n\n\tnpm install promise-now\n\n## Example\n\n```javascript\nvar Promise = require('promise-now');\nvar promise = new Promise();\n\npromise.then(addOne).then(addOne).then(function(num) {\n\tconsole.log(num); // 3\n});\npromise.fulfill(1);\n\nfunction addOne(num) {\n\treturn num + 1;\n}\n```\n\n## API\n\n```javascript\npromise.then(fulfullCallack, rejectCallback);\n```\n\nSee the [Q tutorial](https://github.com/kriskowal/q#tutorial), if you are not familiar with promises.\n\n```javascript\npromise.fulfill(value, [context]);\n```\n\nFullfil `promise` with `value`. `this` keywords equals to `context` in callbacks if provided. Returns `promise`.\n\n```javascript\npromise.reject(reason, [context]);\n```\n\nReject `promise` with `reason`. `this` keywords equals to `context` in callbacks if provided.Returns `promise`.\n\n## `.then()` being asynchonous\n\nIf you can be sure that you will never write code like:\n\n```javascript\nvar promise = new Promise().fulfill();\n\npromise.then(function() {\n\tconsole.log(2);\n});\nconsole.log(1);\n```\n\nIn other words, you will not put synchronous code after asynchronous function calls, then it doesn't make a difference if `.then()` is asynchronous or not.\n\nBy default, promise-now use synchronous `.then()`. If you need the asynchronous version, simply patch promise-now (see `test/promise.js` on how it's done).","readmeFilename":"README.md","_id":"promise-now@0.5.1","dist":{"shasum":"2cb9ab61e976d1523fc6118617b7b0ff30e70496","tarball":"https://registry.npmjs.org/promise-now/-/promise-now-0.5.1.tgz","integrity":"sha512-YWKW6N53SAypLtohAVHT/sGWhN8vL7Izkupl0YsxJTFYYHIQMJs3GD3Jzk79wX1FzBUNLcC8/imQuM959Bco7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAFcXOmHAM9Vc1e7KfFNNHMQdTcmfYm9K9KMC8pNGiNWAiEAv3g+VduIka2WU0hzvI1d34F8Nj8D5NB7rGqndm8iPaQ="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"curvedmark","email":"curvedmark@gmail.com"},"maintainers":[{"name":"curvedmark","email":"curvedmark@gmail.com"}]},"1.0.0":{"name":"promise-now","version":"1.0.0","description":"Barebone Promise/A+ implementation","main":"lib/Promise.js","directories":{"lib":"lib","test":"test"},"devDependencies":{"promises-aplus-tests":"*","mocha":"1.x","mocha-as-promised":"1.x"},"scripts":{"test":"promises-aplus-tests test/promise.js --bail --reporter dot && mocha test/promiseSync.js"},"repository":{"type":"git","url":"https://github.com/curvedmark/promise-now.git"},"keywords":["promise","promises","promises-a","promises-aplus","async","deferred","future","flow control"],"author":{"name":"Glen Huang","email":"curvedmark@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/curvedmark/promise-now/issues"},"readme":"# promise-now\n\nBarebone [Promise/A+](http://promisesaplus.com/) implementation.\n\n## Features\n\n- Extremely small (~ 1kb minified), [extremely fast](http://jsperf.com/wqfwewefewrw/18)\n\n- `.then()` being asynchronous is optional.\n\n- Passing the [Promises/A+ Compliance Test Suite](https://github.com/promises-aplus/promises-tests)\n\n## Installation\n\n\tnpm install promise-now\n\n## Example\n\n```javascript\nvar Promise = require('promise-now');\nvar promise = new Promise();\n\npromise.then(addOne).then(addOne).then(function(num) {\n\tconsole.log(num); // 3\n});\npromise.fulfill(1);\n\nfunction addOne(num) {\n\treturn num + 1;\n}\n```\n\n## API\n\n\n### promise.then(fulfillCallack, rejectCallback);\n\nCall `fulfillCallack(value)` if `promise` is fulfilled with `value`.\n\nOr call `rejectCallback(reason)` if `promise` is rejected with `reason`.\n\nReturn a new promise.\n\n### promise.fulfill(value, [context]);\n\nFulfill `promise` with `value`. `this` keyword equals to `context` in callbacks if provided. Returns `promise`.\n\n### promise.reject(reason, [context]);\n\nReject `promise` with `reason`. `this` keyword equals to `context` in callbacks if provided.Returns `promise`.\n\n## .then() being asynchronous\n\nIf you can be sure that you will never write code like:\n\n```javascript\nvar promise = new Promise().fulfill();\n\npromise.then(function() {\n\tconsole.log(2);\n});\nconsole.log(1);\n```\n\nIn other words, you will not put synchronous code after asynchronous function calls, then it doesn't make a difference if `.then()` is asynchronous or not.\n\nBy default, promise-now use synchronous `.then()`. If you need the asynchronous version, simply patch promise-now (see `test/promise.js` on how it's done).","readmeFilename":"README.md","_id":"promise-now@1.0.0","dist":{"shasum":"6b1397536c1337a2749639fac3433bd0837a14be","tarball":"https://registry.npmjs.org/promise-now/-/promise-now-1.0.0.tgz","integrity":"sha512-/jyr9q7m3xBrG965Pubh5jezEa/jDWH4GHY1RKLdaLMVSPGkdMRRFDowGE2yNl/X1UGyjR3+oEJf2mJjI7wfOQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+TkiBYK99wG6lotucfzsxR9G6IJqasZZ/s5o3VMxJmwIhAKBkoODizAOjC/2Urt+sXX+m08SNHHxkyg5tEg2tDPub"}]},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"curvedmark","email":"curvedmark@gmail.com"},"maintainers":[{"name":"curvedmark","email":"curvedmark@gmail.com"}]},"1.1.0":{"name":"promise-now","version":"1.1.0","description":"Barebone Promise/A+ implementation","main":"lib/Promise.js","directories":{"lib":"lib","test":"test"},"devDependencies":{"promises-aplus-tests":"*","mocha":"1.x","mocha-as-promised":"1.x"},"scripts":{"test":"promises-aplus-tests test/promise.js --bail --reporter dot && mocha test/promiseSync.js"},"repository":{"type":"git","url":"https://github.com/curvedmark/promise-now.git"},"keywords":["promise","promises","promises-a","promises-aplus","async","deferred","future","flow control"],"author":{"name":"Glen Huang","email":"curvedmark@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/curvedmark/promise-now/issues"},"readme":"# promise-now\n\nBarebone [Promise/A+](http://promisesaplus.com/) implementation.\n\n## Features\n\n- Extremely small (~ 1kb minified), [extremely fast](http://jsperf.com/wqfwewefewrw/18)\n\n- `.then()` being asynchronous is optional.\n\n- Passing the [Promises/A+ Compliance Test Suite](https://github.com/promises-aplus/promises-tests)\n\n## Installation\n\n\tnpm install promise-now\n\n## Example\n\n```javascript\nvar Promise = require('promise-now');\nvar promise = new Promise();\n\npromise.then(addOne).then(addOne).then(function(num) {\n\tconsole.log(num); // 3\n});\npromise.fulfill(1);\n\nfunction addOne(num) {\n\treturn num + 1;\n}\n```\n\n## API\n\n\n### promise.then([fulfillCallack], [rejectCallback]);\n\nCall `fulfillCallack(value)` if `promise` is fulfilled with `value`.\n\nOr call `rejectCallback(reason)` if `promise` is rejected with `reason`.\n\nReturn a new promise.\n\n### promise.fulfill(value, [context]);\n\nFulfill `promise` with `value`. `this` keyword equals to `context` in callbacks if provided.\n\nReturn original `promise`.\n\n### promise.reject(reason, [context]);\n\nReject `promise` with `reason`. `this` keyword equals to `context` in callbacks if provided.\n\nReturn original `promise`.\n\n### promise.done([fulfillCallack], [rejectCallback]);\n\nLike `.then()`, but throw with reason (asynchronously) if promise is rejected. Should be called at the end of `.then()` chain.\n\nReturn `undefined`.\n\n## .then() being asynchronous\n\nIf you can be sure that you will never write code like:\n\n```javascript\nvar promise = new Promise().fulfill();\n\npromise.then(function() {\n\tconsole.log(2);\n});\nconsole.log(1);\n```\n\nIn other words, you will not put synchronous code after asynchronous function calls, then it doesn't make a difference if `.then()` is asynchronous or not.\n\nBy default, promise-now use synchronous `.then()`. If you need the asynchronous version, simply patch promise-now (see `test/promise.js` on how it's done).","readmeFilename":"README.md","_id":"promise-now@1.1.0","dist":{"shasum":"7f200e6beb40dabf4e598d952038e05beeb17160","tarball":"https://registry.npmjs.org/promise-now/-/promise-now-1.1.0.tgz","integrity":"sha512-eRZWbl4z6godD/4pfbopsu6RnhkA7+ETbDm+pKhZ0NRZLTwkRBvVIFxGc6lnwFJq3YXao0pLsapIm+8cq7vuag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzwdwAqSPc2Q6u/f262ohvgTuHDcbY0oJShp3lnux9iwIhAO+SX3c69V78u/ZE97rp3lRcJTSRAT+UlT4SUGpUAyDg"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"curvedmark","email":"curvedmark@gmail.com"},"maintainers":[{"name":"curvedmark","email":"curvedmark@gmail.com"}]}},"readme":"# Promise Now\n\nBarebone [Promise/A+](http://promisesaplus.com/) implementation. `.then()` being asynchronous is optional.\n\n## Installation\n\n\tnpm install promise-now\n\n## Example\n\n```javascript\nvar Promise = require('promise-now');\nvar promise = new Promise();\n\npromise.then(addOne).then(addOne).then(function(num) {\n\tconsole.log(num); // 3\n});\npromise.fulfill(1);\n\nfunction addOne(num) {\n\treturn num + 1;\n}\n```\n\n## API\n\n```javascript\npromise.then(fulfullCallack, rejectCallback);\n```\n\nSee the [Q tutorial](https://github.com/kriskowal/q#tutorial), if you are not familiar with promises.\n\n```javascript\npromise.fulfill(value);\n```\n\nFullfil `promise` with `value`. This method only exists on the promises created by `new Promise()`, not on promises returned by `.then()`.\n\nReturns `promise`.\n\n```javascript\npromise.reject(reason);\n```\n\nReject `promise` with `reason`. This method only exists on the promises created by `new Promise()`, not on promises returned by `.then()`.\n\nReturns `promise`.\n\n## Optionally being asynchonous\n\nIf you can be sure that you will never write code like:\n\n```javascript\nvar promise = new Promise().fulfill();\n\npromise.then(function() {\n\tconsole.log(2);\n});\nconsole.log(1);\n```\n\nIn other words, you will not put synchronous code after asynchronous function calls, it doesn't make a difference if `.then()` is asynchronous or not.\n\nBy default, promise-now use synchronous `.then()`. If you need the asynchronous version, consider using another promise library, or patch promise-now youself (see `test/promise.js` on how it's done).","maintainers":[{"name":"curvedmark","email":"curvedmark@gmail.com"}],"time":{"modified":"2022-06-24T18:53:55.768Z","created":"2013-07-30T05:57:02.853Z","0.1.0":"2013-07-30T05:57:08.417Z","0.2.0":"2013-07-30T09:13:09.668Z","0.2.1":"2013-07-31T01:14:33.945Z","0.2.2":"2013-07-31T02:21:31.548Z","0.3.0":"2013-08-01T11:21:38.587Z","0.4.0":"2013-08-01T12:23:55.396Z","0.4.1":"2013-08-02T02:11:44.732Z","0.5.1":"2013-08-02T06:16:29.632Z","0.6.0":"2013-08-11T08:50:03.499Z","1.0.0":"2013-08-19T04:41:12.135Z","1.1.0":"2013-08-21T14:24:39.156Z"},"author":{"name":"Glen Huang","email":"curvedmark@gmail.com"},"repository":{"type":"git","url":"https://github.com/curvedmark/promise-now.git"}}