{"_id":"promiscuous","_rev":"78542","name":"promiscuous","description":"A minimal and fast promise implementation","dist-tags":{"latest":"0.7.2"},"maintainers":[{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"}],"time":{"modified":"2021-06-03T10:25:11.000Z","created":"2013-01-20T15:49:41.928Z","0.7.2":"2018-09-05T13:49:16.785Z","0.7.1":"2017-08-11T00:48:58.919Z","0.7.0":"2016-12-01T11:48:22.282Z","0.6.0":"2014-01-26T13:28:32.815Z","0.5.1":"2014-01-03T18:39:20.616Z","0.5.0":"2013-12-31T12:55:29.084Z","0.4.0":"2013-12-15T22:20:09.333Z","0.3.0":"2013-08-02T08:48:40.667Z","0.2.0":"2013-02-03T23:18:38.848Z","0.1.0":"2013-01-20T15:49:41.928Z"},"users":{"joelwallis":true,"drewigg":true},"author":{"name":"Ruben Verborgh","email":"ruben.verborgh@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/RubenVerborgh/promiscuous.git"},"versions":{"0.7.2":{"name":"promiscuous","version":"0.7.2","description":"A minimal and fast promise implementation","author":{"name":"Ruben Verborgh","email":"ruben.verborgh@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/RubenVerborgh/promiscuous.git"},"bugs":{"url":"https://github.com/RubenVerborgh/promiscuous/issues"},"main":"promiscuous.js","scripts":{"test":"promises-aplus-tests test/adapter"},"devDependencies":{"promises-aplus-tests":"2.0.x","uglify-js":"2.2.x"},"gitHead":"6d24afd5a7830df32bbcabf3374239d11192afef","homepage":"https://github.com/RubenVerborgh/promiscuous#readme","_id":"promiscuous@0.7.2","_npmVersion":"6.4.1","_nodeVersion":"10.9.0","_npmUser":{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"},"dist":{"shasum":"aab035ed3eec6c675edcdae4886f328a5e959bcd","size":5399,"noattachment":false,"key":"/promiscuous/-/promiscuous-0.7.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/promiscuous/download/promiscuous-0.7.2.tgz"},"maintainers":[{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promiscuous_0.7.2_1536155356640_0.5769256885667011"},"_hasShrinkwrap":false,"publish_time":1536155356785,"_cnpm_publish_time":1536155356785},"0.7.1":{"name":"promiscuous","version":"0.7.1","description":"A minimal and fast promise implementation","author":{"name":"Ruben Verborgh","email":"ruben.verborgh@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/RubenVerborgh/promiscuous.git"},"bugs":{"url":"https://github.com/RubenVerborgh/promiscuous/issues"},"main":"promiscuous.js","scripts":{"test":"promises-aplus-tests test/adapter"},"devDependencies":{"promises-aplus-tests":"2.0.x","uglify-js":"2.2.x"},"gitHead":"db453936a5183491ceb1f8c01e0a4e1fd9e9678d","homepage":"https://github.com/RubenVerborgh/promiscuous#readme","_id":"promiscuous@0.7.1","_npmVersion":"5.3.0","_nodeVersion":"8.1.3","_npmUser":{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"},"dist":{"shasum":"8a1754feb694b0c53964e49e633afb646c51b76e","size":5451,"noattachment":false,"key":"/promiscuous/-/promiscuous-0.7.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/promiscuous/download/promiscuous-0.7.1.tgz"},"maintainers":[{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promiscuous-0.7.1.tgz_1502412538012_0.01387339667417109"},"directories":{},"publish_time":1502412538919,"_cnpm_publish_time":1502412538919,"_hasShrinkwrap":false},"0.7.0":{"name":"promiscuous","version":"0.7.0","description":"A minimal and fast promise implementation","author":{"name":"Ruben Verborgh","email":"ruben.verborgh@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/RubenVerborgh/promiscuous.git"},"bugs":{"url":"https://github.com/RubenVerborgh/promiscuous/issues"},"main":"promiscuous.js","scripts":{"test":"promises-aplus-tests test/adapter"},"devDependencies":{"promises-aplus-tests":"2.0.x","uglify-js":"2.2.x"},"gitHead":"c305e15b311559401978e63962710edc71f554b5","homepage":"https://github.com/RubenVerborgh/promiscuous#readme","_id":"promiscuous@0.7.0","_shasum":"0104ed8081fe32a3bf9c97aebb7b645097935300","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.7.0","_npmUser":{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"},"dist":{"shasum":"0104ed8081fe32a3bf9c97aebb7b645097935300","size":4518,"noattachment":false,"key":"/promiscuous/-/promiscuous-0.7.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/promiscuous/download/promiscuous-0.7.0.tgz"},"maintainers":[{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/promiscuous-0.7.0.tgz_1480592900177_0.20024387794546783"},"directories":{},"publish_time":1480592902282,"_cnpm_publish_time":1480592902282,"_hasShrinkwrap":false},"0.6.0":{"name":"promiscuous","version":"0.6.0","description":"A minimal and fast promise implementation","author":{"name":"Ruben Verborgh","email":"ruben.verborgh@gmail.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/RubenVerborgh/promiscuous.git"},"bugs":{"url":"https://github.com/RubenVerborgh/promiscuous/issues"},"main":"promiscuous.js","scripts":{"test":"promises-aplus-tests test/adapter"},"devDependencies":{"promises-aplus-tests":"2.0.x","uglify-js":"2.2.x"},"homepage":"https://github.com/RubenVerborgh/promiscuous","_id":"promiscuous@0.6.0","dist":{"shasum":"54014cd3d62cafe831e3354990c05ff5b78c8892","size":4348,"noattachment":false,"key":"/promiscuous/-/promiscuous-0.6.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/promiscuous/download/promiscuous-0.6.0.tgz"},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"},"maintainers":[{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"}],"directories":{},"publish_time":1390742912815,"_cnpm_publish_time":1390742912815,"_hasShrinkwrap":false},"0.5.1":{"name":"promiscuous","version":"0.5.1","description":"A minimal and fast promise implementation","author":{"name":"Ruben Verborgh","email":"ruben.verborgh@gmail.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/RubenVerborgh/promiscuous.git"},"bugs":{"url":"https://github.com/RubenVerborgh/promiscuous/issues"},"main":"promiscuous.js","scripts":{"test":"promises-aplus-tests test/adapter"},"devDependencies":{"promises-aplus-tests":"2.0.x","uglify-js":"2.2.x"},"readmeFilename":"README.md","homepage":"https://github.com/RubenVerborgh/promiscuous","_id":"promiscuous@0.5.1","dist":{"shasum":"de968aee71a91d9082af54e07cc56589f7221930","size":3935,"noattachment":false,"key":"/promiscuous/-/promiscuous-0.5.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/promiscuous/download/promiscuous-0.5.1.tgz"},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"},"maintainers":[{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"}],"directories":{},"publish_time":1388774360616,"_cnpm_publish_time":1388774360616,"_hasShrinkwrap":false},"0.5.0":{"name":"promiscuous","version":"0.5.0","description":"A minimal and fast promise implementation","author":{"name":"Ruben Verborgh","email":"ruben.verborgh@gmail.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/RubenVerborgh/promiscuous.git"},"bugs":{"url":"https://github.com/RubenVerborgh/promiscuous/issues"},"main":"promiscuous.js","scripts":{"test":"promises-aplus-tests test/adapter"},"devDependencies":{"promises-aplus-tests":"2.0.x","uglify-js":"2.2.x"},"readmeFilename":"README.md","homepage":"https://github.com/RubenVerborgh/promiscuous","_id":"promiscuous@0.5.0","dist":{"shasum":"61944006cd21cc89a7b4a599f5ba29588aa6645e","size":3912,"noattachment":false,"key":"/promiscuous/-/promiscuous-0.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/promiscuous/download/promiscuous-0.5.0.tgz"},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"},"maintainers":[{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"}],"directories":{},"publish_time":1388494529084,"_cnpm_publish_time":1388494529084,"_hasShrinkwrap":false},"0.4.0":{"name":"promiscuous","version":"0.4.0","description":"A minimal and fast promise/deferred implementation","author":{"name":"Ruben Verborgh","email":"ruben.verborgh@gmail.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/RubenVerborgh/promiscuous.git"},"bugs":{"url":"https://github.com/RubenVerborgh/promiscuous/issues"},"main":"promiscuous.js","scripts":{"test":"promises-aplus-tests test/adapter"},"devDependencies":{"promises-aplus-tests":"2.0.x","uglify-js":"2.2.x"},"readmeFilename":"README.md","homepage":"https://github.com/RubenVerborgh/promiscuous","_id":"promiscuous@0.4.0","dist":{"shasum":"8071ac1aff13dbcac99680c29257263e8634c2a5","size":20236,"noattachment":false,"key":"/promiscuous/-/promiscuous-0.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/promiscuous/download/promiscuous-0.4.0.tgz"},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"},"maintainers":[{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"}],"directories":{},"publish_time":1387146009333,"_cnpm_publish_time":1387146009333,"_hasShrinkwrap":false},"0.3.0":{"name":"promiscuous","version":"0.3.0","description":"A minimal and fast promise/deferred implementation","author":{"name":"Ruben Verborgh","email":"ruben.verborgh@gmail.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/RubenVerborgh/promiscuous.git"},"bugs":{"url":"https://github.com/RubenVerborgh/promiscuous/issues"},"main":"promiscuous.js","scripts":{"test":"promises-aplus-tests test/adapter"},"devDependencies":{"promises-aplus-tests":"*","uglify-js":"2.2.x"},"_id":"promiscuous@0.3.0","dist":{"shasum":"47c31b5ecdb93aea01b291c5d6c6bbe3272b83ac","size":3160,"noattachment":false,"key":"/promiscuous/-/promiscuous-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/promiscuous/download/promiscuous-0.3.0.tgz"},"_npmVersion":"1.1.62","_npmUser":{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"},"maintainers":[{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"}],"directories":{},"publish_time":1375433320667,"_cnpm_publish_time":1375433320667,"_hasShrinkwrap":false},"0.2.0":{"name":"promiscuous","version":"0.2.0","description":"A minimal and fast promise/deferred implementation","author":{"name":"Ruben Verborgh","email":"ruben.verborgh@gmail.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/RubenVerborgh/promiscuous.git"},"bugs":{"url":"https://github.com/RubenVerborgh/promiscuous/issues"},"main":"promiscuous.js","scripts":{"test":"promises-aplus-tests test/adapter"},"devDependencies":{"promises-aplus-tests":"*","uglify-js":"2.2.x"},"_id":"promiscuous@0.2.0","dist":{"shasum":"a2847a1fdf9bb3974f4e75761eeb8575230b5bff","size":2642,"noattachment":false,"key":"/promiscuous/-/promiscuous-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/promiscuous/download/promiscuous-0.2.0.tgz"},"_npmVersion":"1.1.62","_npmUser":{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"},"maintainers":[{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"}],"directories":{},"publish_time":1359933518848,"_cnpm_publish_time":1359933518848,"_hasShrinkwrap":false},"0.1.0":{"name":"promiscuous","version":"0.1.0","description":"A minimal and fast promise/deferred implementation","author":{"name":"Ruben Verborgh","email":"ruben.verborgh@gmail.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/RubenVerborgh/promiscuous.git"},"bugs":{"url":"https://github.com/RubenVerborgh/promiscuous/issues"},"main":"promiscuous.js","scripts":{"test":"promises-aplus-tests test/adapter"},"devDependencies":{"promises-aplus-tests":"*","uglify-js":"2.2.x"},"_id":"promiscuous@0.1.0","dist":{"shasum":"8555d0130758cb1002af9b0da503f4673cff75bc","size":2677,"noattachment":false,"key":"/promiscuous/-/promiscuous-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/promiscuous/download/promiscuous-0.1.0.tgz"},"_npmVersion":"1.1.62","_npmUser":{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"},"maintainers":[{"name":"rubenverborgh","email":"ruben.verborgh@gmail.com"}],"directories":{},"publish_time":1358696981928,"_cnpm_publish_time":1358696981928,"_hasShrinkwrap":false}},"readme":"# promiscuous\n<a href=\"http://promises-aplus.github.com/promises-spec\">\n  <img src=\"http://promises-aplus.github.com/promises-spec/assets/logo-small.png\"\n       alt=\"Promises/A+ logo\" title=\"Promises/A+ 1.0 compliant\" align=\"right\" />\n</a>\n\npromiscuous is a tiny implementation of the [Promises/A+ spec](http://promises-aplus.github.com/promises-spec/).\n\nIt is promise library in JavaScript, **small** (< 1kb [minified](https://raw.github.com/RubenVerborgh/promiscuous/dist/promiscuous-node.js) / < 0.6kb gzipped) and **fast**.\n\n## Installation and usage\n### Node\nFirst, install promiscuous with npm.\n```bash\n$ npm install promiscuous\n```\n\nThen, include promiscuous in your code file.\n```javascript\nvar Promise = require('promiscuous');\n```\n\n### Browsers\nInclude [promiscuous](https://raw.github.com/RubenVerborgh/promiscuous/dist/promiscuous-browser.js) in your HTML file.\n```html\n<script src=\"promiscuous-browser.js\"></script>\n```\n\nThis version (and a minified one) can be built with:\n```bash\n$ build/build.js\n```\n\n## API\n### Create a resolved promise\n```javascript\nvar promise = Promise.resolve(\"one\");\npromise.then(function (value) { console.log(value); });\n/* one */\n```\n\n### Create a rejected promise\n```javascript\nvar brokenPromise = Promise.reject(new Error(\"Could not keep promise.\"));\nbrokenPromise.then(null, function (error) { console.error(error.message); });\n/* \"Could not keep promise.\" */\n```\n\nYou can also use the `catch` method if there is no success callback:\n\n```javascript\nbrokenPromise.catch(function (error) { console.error(error.message); });\n/* \"Could not keep promise.\" */\n```\n\n### Write a function that returns a promise\n```javascript\nfunction promiseLater(something) {\n  return new Promise(function (resolve, reject) {\n    setTimeout(function () {\n      if (something)\n        resolve(something);\n      else\n        reject(new Error(\"nothing\"));\n    }, 1000);\n  });\n}\npromiseLater(\"something\").then(\n  function (value) { console.log(value); },\n  function (error) { console.error(error.message); });\n/* something */\n\npromiseLater(null).then(\n  function (value) { console.log(value); },\n  function (error) { console.error(error.message); });\n/* nothing */\n```\n\n### Convert an array of promises into a promise for an array\n```javascript\nvar promises = [promiseLater(1), promiseLater(2), promiseLater(3)];\nPromise.all(promises).then(function (values) { console.log(values); });\n/* [1, 2, 3] */\n```\n","_attachments":{},"homepage":"https://github.com/RubenVerborgh/promiscuous#readme","bugs":{"url":"https://github.com/RubenVerborgh/promiscuous/issues"},"license":"MIT"}