{"_id":"handle-callback","_rev":"23-49bc85a1704654b862f46cef24dd99d3","name":"handle-callback","description":"Make promise to have support for callback api, it returns promise in that same time.","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"handle-callback","version":"1.0.0","description":"Initial step for creating hybrid APIs, used by `hybridify`. Handle callback in promise - give promise and callback return promise.","scripts":{"lint":"jshint index.js && jscs index.js --reporter inline","test":"mocha","test-cov":"istanbul cover _mocha","test-travis":"istanbul cover _mocha --report lcovonly"},"author":{"name":"Charlike Make Reagent","email":"mameto_100@mail.bg","url":"https://github.com/tunnckoCore"},"repository":{"type":"git","url":"git://github.com/tunnckoCore/handle-callback.git"},"keywords":[],"license":{"type":"MIT","url":"https://github.com/tunnckoCore/handle-callback/blob/master/license.md"},"dependencies":{"is-promise":"^1.0.1"},"devDependencies":{"bluebird":"^2.8.2","istanbul-harmony":"^0.3.1","mocha":"*","mocha-lcov-reporter":"^0.0.1","then-got":"^1.0.2"},"gitHead":"90d4504ab043296d991ee00601ca7cded57324ff","bugs":{"url":"https://github.com/tunnckoCore/handle-callback/issues"},"homepage":"https://github.com/tunnckoCore/handle-callback","_id":"handle-callback@1.0.0","_shasum":"31739276c2b1a8ef28bcc45fe91fc9bf9bd43566","_from":".","_npmVersion":"2.1.16","_nodeVersion":"0.11.14","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"dist":{"shasum":"31739276c2b1a8ef28bcc45fe91fc9bf9bd43566","tarball":"https://registry.npmjs.org/handle-callback/-/handle-callback-1.0.0.tgz","integrity":"sha512-BNPAqyattTTPZjkwdx6rdGW27GlY2T9ZWnmwaxC+Y2Njmdw+94Xwbhe1y5CGwWRDLb5v4SKzauB/wt+5+qFWDw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCr6FhyhhR+7ugCCGy9rbO9+ZMNf+wroTZ3DqplqXzDcgIhAK7BGnUaSsMzNtgqifTZ/6WbE3n4sMpcWEjpp2XCCV4Q"}]},"directories":{}},"1.0.1":{"name":"handle-callback","version":"1.0.1","description":"Initial step for creating hybrid APIs, used by `hybridify`. Handle callback in promise - give promise and callback return promise.","scripts":{"lint":"jshint index.js && jscs index.js --reporter inline","test":"mocha","test-cov":"istanbul cover _mocha","test-travis":"istanbul cover _mocha --report lcovonly"},"author":{"name":"Charlike Make Reagent","email":"mameto_100@mail.bg","url":"https://github.com/tunnckoCore"},"repository":{"type":"git","url":"git://github.com/tunnckoCore/handle-callback.git"},"keywords":["api","apis","aplus","args","argument","arguments","bluebird","callback","callbacks","cb","handle","handle-callback","hybrid","hybrid-apis","hybridify","promise","promises","promises-aplus","then"],"license":{"type":"MIT","url":"https://github.com/tunnckoCore/handle-callback/blob/master/license.md"},"dependencies":{"is-promise":"^1.0.1"},"devDependencies":{"bluebird":"^2.8.2","istanbul-harmony":"^0.3.1","mocha":"*","mocha-lcov-reporter":"^0.0.1","then-got":"^1.0.2"},"gitHead":"0c2f71bcc0c7f9627eb8f227aa7d55c9f86e9ac3","bugs":{"url":"https://github.com/tunnckoCore/handle-callback/issues"},"homepage":"https://github.com/tunnckoCore/handle-callback","_id":"handle-callback@1.0.1","_shasum":"87b669387f3c3ad8882191fd45be1342ca073b47","_from":".","_npmVersion":"2.1.16","_nodeVersion":"0.11.14","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"dist":{"shasum":"87b669387f3c3ad8882191fd45be1342ca073b47","tarball":"https://registry.npmjs.org/handle-callback/-/handle-callback-1.0.1.tgz","integrity":"sha512-PZjPdiyjiGuClH5xLcwzAPJtg7hJ+2hlsxhujp1J3Jz06lNlym1pM8Si5g1+CGeUJ8X8KGHyyrh+pSSh9ky6Qw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzL91hDbN4YlzVY/bR5NkZoD6HTWLV77fUvtT2cPO/LgIhAMth1FUrHSyKbDS3wXZ+a7RpX6MtEEq4KPsQJfa8reLF"}]},"directories":{}},"1.0.2":{"name":"handle-callback","version":"1.0.2","description":"Initial step for creating hybrid APIs, used by `hybridify`. Handle callback in promise - give promise and callback return promise.","scripts":{"lint":"jshint index.js && jscs index.js --reporter inline","test":"mocha","test-cov":"istanbul cover _mocha","test-travis":"istanbul cover _mocha --report lcovonly"},"author":{"name":"Charlike Make Reagent","email":"mameto_100@mail.bg","url":"https://github.com/tunnckoCore"},"repository":{"type":"git","url":"git://github.com/hybridables/handle-callback.git"},"keywords":["api","apis","aplus","args","argument","arguments","bluebird","callback","callbacks","cb","handle","handle-callback","hybrid","hybrid-apis","hybridify","promise","promises","promises-aplus","then"],"license":{"type":"MIT","url":"https://github.com/hybridables/handle-callback/blob/master/license.md"},"dependencies":{"is-promise":"^1.0.1"},"devDependencies":{"bluebird":"^2.8.2","istanbul-harmony":"^0.3.1","mocha":"*","mocha-lcov-reporter":"^0.0.1","then-got":"^1.0.3"},"gitHead":"cc0cf301c164b23b952a1abf3a9cb929633dd424","bugs":{"url":"https://github.com/hybridables/handle-callback/issues"},"homepage":"https://github.com/hybridables/handle-callback","_id":"handle-callback@1.0.2","_shasum":"53f94027803265eb901de54fc39bbeb5feba4c90","_from":".","_npmVersion":"2.1.16","_nodeVersion":"0.11.14","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"dist":{"shasum":"53f94027803265eb901de54fc39bbeb5feba4c90","tarball":"https://registry.npmjs.org/handle-callback/-/handle-callback-1.0.2.tgz","integrity":"sha512-9GTQ5tw5d7MpNLKW0VnF8FiMhTxEfVKV0axiKoisqJCA15IckVfxU/nKiFBefHuDeglXMh6F7lsEvauk67uRKA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAdV38Nw3gJxoFybZLTk7OiagUY/ARgWzUvDO9AkVaIHAiB87Wzb3YKwOZAJaWGIb2phyxcxM0u09MJd8EwWkyl9mA=="}]},"directories":{}},"1.1.0":{"name":"handle-callback","version":"1.1.0","description":"Initial step for creating hybrid APIs, used by `hybridify`. Handle callback in promise - give promise and callback return promise.","scripts":{"lint":"jshint index.js && jscs index.js --reporter inline","test":"mocha","test-cov":"istanbul cover _mocha","test-travis":"istanbul cover _mocha --report lcovonly"},"author":{"name":"Charlike Mike Reagent","email":"mameto_100@mail.bg","url":"https://github.com/tunnckoCore"},"repository":{"type":"git","url":"git://github.com/hybridables/handle-callback.git"},"keywords":["api","apis","aplus","args","argument","arguments","bluebird","callback","callbacks","cb","handle","handle-callback","hybrid","hybrid-apis","hybridify","promise","promises","promises-aplus","then"],"license":{"type":"MIT","url":"https://github.com/hybridables/handle-callback/blob/master/license.md"},"dependencies":{"is-promise":"~2.0.0"},"devDependencies":{"bluebird":"~2.9.0","istanbul-harmony":"~0.3.1","mocha":"~2.1.0","then-got":"~1.0.5"},"gitHead":"3338df71dd52f6f4c60ab2ddefbb950617fff2f7","bugs":{"url":"https://github.com/hybridables/handle-callback/issues"},"homepage":"https://github.com/hybridables/handle-callback","_id":"handle-callback@1.1.0","_shasum":"ca079639b62bef9978e0ac0bdded7acb85a37964","_from":".","_npmVersion":"2.6.1","_nodeVersion":"1.4.2","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"dist":{"shasum":"ca079639b62bef9978e0ac0bdded7acb85a37964","tarball":"https://registry.npmjs.org/handle-callback/-/handle-callback-1.1.0.tgz","integrity":"sha512-D1PSJ4ks5eEPNfAkVe+rY9kqjQkkpWyFIHU6KK+hwi1JmCL2vjCEv3DWUEfXm9SWkRUCy/zrXGosTw2+uCx9SA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLd8fJk8gaMIfcUwVvhjPO/C3H3WtnkbWK0U7eAPetpwIgJtK5vDwT96oTTVWCm8T69c84cJgt9QZieswjpbQpakw="}]},"directories":{}},"2.0.0":{"name":"handle-callback","version":"2.0.0","description":"Make promise to have support for callback api, it returns promise in that same time.","repository":{"type":"git","url":"git+https://github.com/hybridables/handle-callback.git"},"author":{"name":"Charlike Mike Reagent","email":"@tunnckoCore","url":"http://www.tunnckocore.tk"},"main":"index.js","license":"MIT","scripts":{"test":"standard && node test.js"},"dependencies":{"is-promise":"~2.0.0","promise2thunk":"~1.0.0"},"devDependencies":{"assertit":"^0.1.0","bluebird":"^2.9.27","then-got":"^1.0.7"},"keywords":["api","apis","aplus","args","argument","arguments","bluebird","callback","callbacks","cb","handle","handle-callback","hybrid","hybrid-apis","hybridify","promise","promises","promises-aplus","then"],"gitHead":"0e4d81a98ce9789cb784acb25debe40297b38f09","bugs":{"url":"https://github.com/hybridables/handle-callback/issues"},"homepage":"https://github.com/hybridables/handle-callback#readme","_id":"handle-callback@2.0.0","_shasum":"c17078add7f79a3d722659b8fc7c3e087d213887","_from":".","_npmVersion":"2.11.0","_nodeVersion":"2.2.1","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"dist":{"shasum":"c17078add7f79a3d722659b8fc7c3e087d213887","tarball":"https://registry.npmjs.org/handle-callback/-/handle-callback-2.0.0.tgz","integrity":"sha512-IjulU44+qy5q+Vym7sc/UehQG7M5FAGG9ZKjQYp4EWZMF9KFrHqxq1dvaCpjuzNNHqlnRXQkwN+u/3CuBak/dw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEtatKr+W3UpoL5lv1AuGxikkyAcRexGGg4iLNLSDhI4AiB8rVxVOOE0SnGL8KklG1N/W3KtdcTZfopFK7UXtpx/lA=="}]},"directories":{}}},"readme":"# handle-callback [![npmjs.com][npmjs-img]][npmjs-url] [![The MIT License][license-img]][license-url] \n\n> Make promise to have support for callback api, it returns promise in that same time.\n\n[![code climate][codeclimate-img]][codeclimate-url] [![standard code style][standard-img]][standard-url] [![travis build status][travis-img]][travis-url] [![coverage status][coveralls-img]][coveralls-url] [![dependency status][david-img]][david-url]\n\n\n## Install\n```\nnpm i handle-callback --save\nnpm test\n```\n\n\n## Usage\n> For more use-cases see the [tests](./test.js)\n\n```js\nvar handleCallback = require('handle-callback')\nvar got = require('then-got')\n\nfunction hybridGot (url, callback) {\n  var promise = got(url)\n\n  if (callback) {\n    promise = handleCallback(promise, callback)\n  }\n\n  return promise\n}\n\nhybridGot('https://github.com')\n.then(function (res) {\n  console.log(res[0])\n  //=> html content of the page\n})\n.catch(console.error)\n\n// or both in same time\nhybridGot('https://github.com', function (err, res) {\n  console.log(err) //=> null\n  console.log(res[0]) //=> html of page\n})\n.then(function (res) {\n  console.log(res[0]) //=> html of page\n})\n.catch(console.error)\n```\n\n\n## Related\n- [make-callback](https://github.com/tunnckocore/make-callback): Make synchronous function to support callback api\n- [always-callback](https://github.com/tunnckocore/always-callback): Create callback api for given sync function. Guarantee that given function (sync or async, no matter) will always have callback api and will handle errors correctly.\n- [always-promise](https://github.com/tunnckocore/always-promise): Create Bluebird Promise from given async or synchronous function. It automatically convert sync functions to async, then to promise.\n- [hybridify](https://github.com/hybridables/hybridify): Building hybrid APIs. You can use both callback and promise in same time.\n- [handle-arguments](https://github.com/hybridables/handle-arguments): Handles given Arguments object - return separatly last argument (commonly callback) and other arguments as Array. Useful in node-style callback flow.\n- [manage-arguments](https://github.com/tunnckocore/manage-arguments): Prevents arguments leakage - managing arguments. From Optimization killers by Petka Antonov.\n- [promise2thunk](https://github.com/tunnckocore/promise2thunk): Convert (transform) promise to thunk, just like was in co@3\n\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/hybridables/handle-callback/issues/new).  \nBut before doing anything, please read the [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines.\n\n\n## [Charlike Make Reagent](http://j.mp/1stW47C) [![new message to charlike][new-message-img]][new-message-url] [![freenode #charlike][freenode-img]][freenode-url]\n\n[![tunnckocore.tk][author-www-img]][author-www-url] [![keybase tunnckocore][keybase-img]][keybase-url] [![tunnckoCore npm][author-npm-img]][author-npm-url] [![tunnckoCore twitter][author-twitter-img]][author-twitter-url] [![tunnckoCore github][author-github-img]][author-github-url]\n\n\n[npmjs-url]: https://www.npmjs.com/package/handle-callback\n[npmjs-img]: https://img.shields.io/npm/v/handle-callback.svg?label=handle-callback\n\n[license-url]: https://github.com/hybridables/handle-callback/blob/master/LICENSE.md\n[license-img]: https://img.shields.io/badge/license-MIT-blue.svg\n\n\n[codeclimate-url]: https://codeclimate.com/github/hybridables/handle-callback\n[codeclimate-img]: https://img.shields.io/codeclimate/github/hybridables/handle-callback.svg\n\n[travis-url]: https://travis-ci.org/hybridables/handle-callback\n[travis-img]: https://img.shields.io/travis/hybridables/handle-callback.svg\n\n[coveralls-url]: https://coveralls.io/r/hybridables/handle-callback\n[coveralls-img]: https://img.shields.io/coveralls/hybridables/handle-callback.svg\n\n[david-url]: https://david-dm.org/hybridables/handle-callback\n[david-img]: https://img.shields.io/david/hybridables/handle-callback.svg\n\n[standard-url]: https://github.com/feross/standard\n[standard-img]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg\n\n\n[author-www-url]: http://www.tunnckocore.tk\n[author-www-img]: https://img.shields.io/badge/www-tunnckocore.tk-fe7d37.svg\n\n[keybase-url]: https://keybase.io/tunnckocore\n[keybase-img]: https://img.shields.io/badge/keybase-tunnckocore-8a7967.svg\n\n[author-npm-url]: https://www.npmjs.com/~tunnckocore\n[author-npm-img]: https://img.shields.io/badge/npm-~tunnckocore-cb3837.svg\n\n[author-twitter-url]: https://twitter.com/tunnckoCore\n[author-twitter-img]: https://img.shields.io/badge/twitter-@tunnckoCore-55acee.svg\n\n[author-github-url]: https://github.com/tunnckoCore\n[author-github-img]: https://img.shields.io/badge/github-@tunnckoCore-4183c4.svg\n\n[freenode-url]: http://webchat.freenode.net/?channels=charlike\n[freenode-img]: https://img.shields.io/badge/freenode-%23charlike-5654a4.svg\n\n[new-message-url]: https://github.com/tunnckoCore/messages\n[new-message-img]: https://img.shields.io/badge/send%20me-message-green.svg\n","maintainers":[{"email":"super.ludiq@gmail.com","name":"vanchoy"},{"email":"mameto2011@gmail.com","name":"tunnckocore"}],"time":{"modified":"2022-06-18T18:51:05.178Z","created":"2015-01-21T03:54:25.404Z","1.0.0":"2015-01-21T03:54:25.404Z","1.0.1":"2015-01-21T03:59:05.451Z","1.0.2":"2015-01-26T03:54:14.378Z","1.1.0":"2015-03-05T00:51:18.126Z","2.0.0":"2015-06-05T11:10:14.426Z"},"homepage":"https://github.com/hybridables/handle-callback#readme","keywords":["api","apis","aplus","args","argument","arguments","bluebird","callback","callbacks","cb","handle","handle-callback","hybrid","hybrid-apis","hybridify","promise","promises","promises-aplus","then"],"repository":{"type":"git","url":"git+https://github.com/hybridables/handle-callback.git"},"author":{"name":"Charlike Mike Reagent","email":"@tunnckoCore","url":"http://www.tunnckocore.tk"},"bugs":{"url":"https://github.com/hybridables/handle-callback/issues"},"license":"MIT","readmeFilename":"README.md"}