{"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":"http://registry-npm.ywwl.com/handle-callback/download/handle-callback-2.0.0.tgz","integrity":"sha512-IjulU44+qy5q+Vym7sc/UehQG7M5FAGG9ZKjQYp4EWZMF9KFrHqxq1dvaCpjuzNNHqlnRXQkwN+u/3CuBak/dw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEtatKr+W3UpoL5lv1AuGxikkyAcRexGGg4iLNLSDhI4AiB8rVxVOOE0SnGL8KklG1N/W3KtdcTZfopFK7UXtpx/lA=="}],"size":4939,"noattachment":false,"key":"/handle-callback/-/handle-callback-2.0.0.tgz"},"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","publish_time":1433502614426,"_cnpm_publish_time":1433502614426,"dist-tags":{"latest":"2.0.0"}}