{"_id":"once-done","_rev":"1759474","name":"once-done","description":"Call a callback when a Promise is settled.","dist-tags":{"latest":"1.0.2"},"maintainers":[{"name":"belym.a.2105","email":"belym.a.2105@gmail.com"}],"time":{"modified":"2026-11-23T09:04:48.000Z","created":"2016-01-21T13:28:24.656Z","1.0.2":"2016-01-21T13:35:46.202Z","1.0.1":"2016-01-21T13:33:46.085Z","1.0.0":"2016-01-21T13:28:24.656Z"},"users":{},"author":{"name":"Andrey Belym","url":"belym.a.2105@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/AndreyBelym/once-done.git"},"versions":{"1.0.2":{"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"}],"publish_time":1453383346202,"_cnpm_publish_time":1453383346202},"1.0.1":{"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"}],"publish_time":1453383226085,"_cnpm_publish_time":1453383226085},"1.0.0":{"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"}],"publish_time":1453382904656,"_cnpm_publish_time":1453382904656}},"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","_attachments":{},"homepage":"https://github.com/AndreyBelym/once-done#readme","bugs":{"url":"https://github.com/AndreyBelym/once-done/issues"},"license":"MIT"}