{"name":"once-done","version":"1.0.1","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/map-reverse.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":"8c0f101aaa579deb56a5cd8015b9eff8c1ee816f","_id":"once-done@1.0.1","_shasum":"b7ac1517c53a5ad57ec673707f372b3f7f44538b","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"belym.a.2105","email":"belym.a.2105@gmail.com"},"dist":{"shasum":"b7ac1517c53a5ad57ec673707f372b3f7f44538b","tarball":"http://registry-npm.ywwl.com/once-done/download/once-done-1.0.1.tgz","integrity":"sha512-iIoYDwhwox3tvdybAt7LZZmrsFc//wRjWykNeUDN/Lf6Buurbm1+USr+AaAHdArWfjPooN1ivGnnunrO8aZ6Jw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAG7pOZbwDZfS46ZIbRE1SQ8MsFT4gWzNN/Gosc51JWRAiA5ilRNbSJtBPGyluVivedsa60Y2DKrYEsOsxFbMYjikw=="}],"size":1894,"noattachment":false,"key":"/once-done/-/once-done-1.0.1.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":1453383226085,"_cnpm_publish_time":1453383226085,"dist-tags":{"latest":"1.0.2"}}