{"name":"once-done","version":"1.0.0","description":"Call a callback when a Promise is settled.","main":"lib/index","devDependencies":{"babel-cli":"^6.4.5","babel-plugin-add-module-exports":"^0.1.2","babel-plugin-transform-es2015-arrow-functions":"^6.4.0","babel-plugin-transform-es2015-modules-commonjs":"^6.4.5","mocha":"^2.3.4","pinkie-promise":"^2.0.0"},"scripts":{"build":"babel src -d lib","pretest":"npm run build","test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/AndreyBelym/cancelable-race.git"},"keywords":["promise"],"author":{"name":"Andrey Belym","url":"belym.a.2105@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/AndreyBelym/once-done/issues"},"homepage":"https://github.com/AndreyBelym/once-done#readme","files":["lib"],"gitHead":"37c546446b4259783049d6b15ac8434a384c1200","_id":"once-done@1.0.0","_shasum":"f80ab19535fe3d3ac6c88b2dbc327d9eca1bb062","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"belym.a.2105","email":"belym.a.2105@gmail.com"},"dist":{"shasum":"f80ab19535fe3d3ac6c88b2dbc327d9eca1bb062","tarball":"http://registry-npm.ywwl.com/once-done/download/once-done-1.0.0.tgz","integrity":"sha512-x8dr+Yfr/EAbe6Yc09RIcXYkmtJDmkiBYydIiAYJZ71uc0h/ML3hySueLDy7+VzPfjKi/N7kCHJMTqK2ay/zBg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXJQ/Rqz8QHctWmlRhPToY4Ac5i1kWOnApUm7HFgwaRwIgE6nfMZ8JnpPl3uyXUaaAGRlwA1sNKgmvPxg0pFF/gDg="}],"size":1897,"noattachment":false,"key":"/once-done/-/once-done-1.0.0.tgz"},"maintainers":[{"name":"belym.a.2105","email":"belym.a.2105@gmail.com"}],"readme":"# once-done\n[![Build Status](https://travis-ci.org/AndreyBelym/once-done.svg?branch=master)](https://travis-ci.org/AndreyBelym/once-done)\n\n*Call a function when a Promise is settled.*\n\nImplementation of [Promise.prototype.finally](https://gist.github.com/rbuckton/66918c8491aa335b003c) as non-method function.\n\nWritten in ES6, transpiled by [Babel](http://babeljs.io/).\n\n## Install\n```\nnpm install once-done\n```\n## Usage\nUse it like `try..finally` for promises:\n```\nvar onceDone = require('once-done');\n\nvar file = getFile();\n\nvar someResultPromise = handleFileAsync(); //someStatsPromise may be rejected\n\nonceDone(someResultPromise, function () {\n    file.close(); //Close the file in any situation\n    return file.deleteAsync(); //You may return Promise, and it will be resolved!\n})\n.then(function (result) {\n    //Handle the result\n})\n.catch(function (reason) {\n    //Check a reason of rejection\n});\n```\n","publish_time":1453382904656,"_cnpm_publish_time":1453382904656,"dist-tags":{"latest":"1.0.2"}}