{"name":"once-done","version":"1.0.2","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/once-done.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":"7765db78018d3e8d7736204b832c8d02bf512583","_id":"once-done@1.0.2","_shasum":"37d916cb84d2f7005a1ebc5a9822349fe9dd5caf","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"belym.a.2105","email":"belym.a.2105@gmail.com"},"dist":{"shasum":"37d916cb84d2f7005a1ebc5a9822349fe9dd5caf","tarball":"http://registry-npm.ywwl.com/once-done/download/once-done-1.0.2.tgz","integrity":"sha512-M7NvPaU9TzHZcu38DT252JMT/FoHplgthN6EGkIjJbHHDvbWsmMBjsYzjuwqcTIiCnPqbDecTswYH5+qU4fyFA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBbBmuD7Uz5cek+wthn7lUrfDz1pJ8zXoCrhxfeJGKb3AiEAh0sYdUraL+D6MMwCyv6dSVqNM0J3Jm1H4jWxS+xyYU8="}],"size":1882,"noattachment":false,"key":"/once-done/-/once-done-1.0.2.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":1453383346202,"_cnpm_publish_time":1453383346202,"dist-tags":{"latest":"1.0.2"}}