{"name":"vow","version":"0.4.6","description":"DOM Promise and Promises/A+ implementation for Node.js and browsers","homepage":"http://dfilatov.github.io/vow/","keywords":["nodejs","browser","async","promise","dom","a+"],"author":{"name":"Dmitry Filatov","email":"dfilatov@yandex-team.ru"},"contributors":[{"name":"Dmitry Filatov","email":"dfilatov@yandex-team.ru"}],"repository":{"type":"git","url":"http://github.com/dfilatov/vow.git"},"dependencies":{},"devDependencies":{"nodeunit":"","istanbul":"","uglify-js":"1.3.4","promises-aplus-tests":"2.1.0","marked":"0.2.10","jspath":"0.2.11","yate":"0.0.65","highlight.js":"7.5.0","bem-jsd":"1.3.1"},"main":"lib/vow","engines":{"node":">= 0.4.0"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js test test/utils/runner.js"},"enb":{"sources":["lib/vow.js"]},"gitHead":"f3543238fcc967c79142ae79130b0ae2a828f538","bugs":{"url":"https://github.com/dfilatov/vow/issues"},"_id":"vow@0.4.6","_shasum":"c87549c6da29369e1d14c15d7ec58cf183dd4d10","_from":".","_npmVersion":"2.1.2","_nodeVersion":"0.10.32","_npmUser":{"name":"dfilatov","email":"dfilatov@yandex-team.ru"},"maintainers":[{"name":"dfilatov","email":"dfilatov@yandex-team.ru"}],"dist":{"shasum":"c87549c6da29369e1d14c15d7ec58cf183dd4d10","tarball":"http://registry-npm.ywwl.com/vow/download/vow-0.4.6.tgz","integrity":"sha512-rIQ2OLDDq21R0QS7zKvYj+Tbed7CqoWD6c3ntNs07QVOHoYzSx8P4NfVbqMHPy5Dz9Mnfj/N2G39LPj/hvLsLg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD13r0KMRiGBopG1UqChPMDo8Z1q7FEA280IaQ+x6lNNQIgfgvdJlciFxr49ufU2PvXZhy5/R2g73nDdYXgH29fo8I="}],"size":8970,"noattachment":false,"key":"/vow/-/vow-0.4.6.tgz"},"directories":{},"readme":"<a href=\"http://promises-aplus.github.com/promises-spec\"><img src=\"http://promises-aplus.github.com/promises-spec/assets/logo-small.png\" align=\"right\" /></a>\r\nVow\r\n[![NPM Version](https://img.shields.io/npm/v/vow.svg?style=flat-square)](https://www.npmjs.com/package/vow)\r\n[![Build Status](https://img.shields.io/travis/dfilatov/vow/master.svg?style=flat-square)](https://travis-ci.org/dfilatov/vow/branches)\r\n[![NPM Downloads](https://img.shields.io/npm/dm/vow.svg?style=flat-square)](https://www.npmjs.org/package/vow)\r\n=========\r\n\r\nVow is a [Promises/A+](http://promisesaplus.com/) implementation.\r\nIt also supports [ES6 Promises](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) specification.\r\n\r\nFull API reference can be found at http://dfilatov.github.io/vow/.\r\n\r\nGetting Started\r\n---------------\r\n### In Node.js ###\r\nYou can install using Node Package Manager (npm):\r\n\r\n    npm install vow\r\n\r\n### In Browsers ###\r\n```html\r\n<script type=\"text/javascript\" src=\"vow.min.js\"></script>\r\n```\r\nIt also supports RequireJS module format and [YM module](https://github.com/ymaps/modules) format.\r\n\r\nVow has been tested in IE6+, Mozilla Firefox 3+, Chrome 5+, Safari 5+, Opera 10+.\r\n\r\nUsage\r\n-----\r\n### Creating a promise ###\r\nThere are two possible ways to create a promise.\r\n#### 1. Using a deferred ####\r\n```js\r\nfunction doSomethingAsync() {\r\n    var deferred = vow.defer();\r\n    \r\n    // now you can resolve, reject, notify corresponging promise within `deferred`\r\n    // e.g. `defer.resolve('ok');`\r\n        \r\n    return deferred.promise(); // and return corresponding promise to subscribe to reactions\r\n}\r\n\r\ndoSomethingAsync().then(\r\n    function() {}, // onFulfilled reaction\r\n    function() {}, // onRejected reaction\r\n    function() {}  // onNotified reaction\r\n    );\r\n```\r\nThe difference between `deferred` and `promise` is that `deferred` contains methods to resolve, reject and notify corresponding promise, but the `promise` by itself allows only to subscribe on these actions.\r\n\r\n#### 2. ES6-compatible way ####\r\n```js\r\nfunction doSomethingAsync() {\r\n    return new vow.Promise(function(resolve, reject, notify) {\r\n        // now you can resolve, reject, notify the promise\r\n    });\r\n}\r\n\r\ndoSomethingAsync().then(\r\n    function() {}, // onFulfilled reaction\r\n    function() {}, // onRejected reaction\r\n    function() {}  // onNotified reaction\r\n    );\r\n```\r\n\r\nExtensions and related projects\r\n-------------------------------\r\n  * [vow-fs](https://github.com/dfilatov/vow-fs) — vow-based file I/O for Node.js\r\n  * [vow-node](https://github.com/dfilatov/vow-node) — extension for vow to work with nodejs-style callbacks\r\n  * [vow-queue](https://github.com/dfilatov/vow-queue) — vow-based task queue with weights and priorities\r\n  * [vow-asker](https://github.com/nodules/vow-asker) — wraps [asker](https://github.com/nodules/asker) API in the vow promises implementation\r\n\r\n**NOTE**. Documentation for old versions of the library can be found at https://github.com/dfilatov/vow/blob/0.3.x/README.md.\r\n","publish_time":1413463368972,"_cnpm_publish_time":1413463368972,"dist-tags":{"latest":"0.4.20"}}