{"_id":"simple-asyncify","_rev":"6-bde563773ed138b0d03179abce16154f","name":"simple-asyncify","description":"Turns sync functions into Node.js-style async ones.","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"simple-asyncify","version":"0.1.0","author":{"name":"Simon Lydell"},"license":"MIT","description":"Turns sync functions into Node.js-style async ones.","main":"index.js","repository":{"type":"git","url":"git://github.com/lydell/simple-asyncify"},"keywords":["async","asyncify","callback"],"scripts":{"test":"jshint index.js test/ && node test/index.js"},"devDependencies":{"jshint":"^2.4.4","tape":"^2.5.0"},"bugs":{"url":"https://github.com/lydell/simple-asyncify/issues"},"homepage":"https://github.com/lydell/simple-asyncify","_id":"simple-asyncify@0.1.0","dist":{"shasum":"28f4391dfb7c1dd20e069086706067d4ffa237da","tarball":"https://registry.npmjs.org/simple-asyncify/-/simple-asyncify-0.1.0.tgz","integrity":"sha512-gVxb3+CaT5U3gRssh3eF0huZQRbyM/D3e/Ka0wApw8lxR7CPJ4RY1WQl4oKUYB7d07lQwm6sP9j8xDjbWG0mIQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFnTO5T0GJ+RKjbCmIUHVWUfzy6OVZFvfo9KPgpN2d66AiBEU4jWTX48pxM7sYO7oUkcDbfnYJNYhvx/RB3XCAqxbA=="}]},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"lydell","email":"simon.lydell@gmail.com"},"maintainers":[{"name":"lydell","email":"simon.lydell@gmail.com"}],"directories":{},"deprecated":"Useless package"},"1.0.0":{"name":"simple-asyncify","version":"1.0.0","author":{"name":"Simon Lydell"},"license":"MIT","description":"Turns sync functions into Node.js-style async ones.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/lydell/simple-asyncify.git"},"keywords":["async","asyncify","callback"],"scripts":{"test":"jshint index.js test/ && node test/index.js"},"devDependencies":{"jshint":"^2.8.0","tape":"^4.2.0"},"gitHead":"0f425e9ddaeb6d659641e1feaf7339a7d3865ce2","bugs":{"url":"https://github.com/lydell/simple-asyncify/issues"},"homepage":"https://github.com/lydell/simple-asyncify#readme","_id":"simple-asyncify@1.0.0","_shasum":"33ed52597be420f72bfe4ace1d85b0a9d36eeefd","_from":".","_npmVersion":"2.9.0","_nodeVersion":"1.8.4","_npmUser":{"name":"lydell","email":"simon.lydell@gmail.com"},"dist":{"shasum":"33ed52597be420f72bfe4ace1d85b0a9d36eeefd","tarball":"https://registry.npmjs.org/simple-asyncify/-/simple-asyncify-1.0.0.tgz","integrity":"sha512-EAYiklqpzM1tEYWKLr/TeKumNKC6Pogs6mUlGfdRZk9z6nYwGXUTD8gtZCbSuz9CAUa/pJw+eJWtL3CrmwL1lA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID6RVI4V/cacXNH1ZMW2T1ZswL9uNH9jk/Ei45SkeMtzAiBv3oF4TxuGm6KDx8Tv9jDdseUKq/4EFK0wuK7l5mOdpA=="}]},"maintainers":[{"name":"lydell","email":"simon.lydell@gmail.com"}],"directories":{},"deprecated":"Useless package"}},"readme":"Overview [![Build Status](https://travis-ci.org/lydell/simple-asyncify.svg?branch=master)](https://travis-ci.org/lydell/simple-asyncify)\n========\n\nTurns sync functions into Node.js-style async ones.\n\nInspired by [node-asyncify].\n\n```js\nvar asyncify = require(\"simple-asyncify\")\n\nfunction addSync(a, b) {\n  if (typeof a !== \"number\" || typeof b !== \"number\") {\n    throw new TypeError(\"add requires two numbers\")\n  }\n  return a + b\n}\n\nvar add = asyncify(addSync)\n\nadd(1, 2, function(error, sum) {\n  console.log(\"The sum is: \" + sum)\n})\n\nadd(1, function(error, sum) {\n  console.log(error.message)\n})\n\nconsole.log(\"Let’s do some math!\")\n\n// Let’s do some math!\n// The sum is: 3\n// add requires two numbers\n```\n\n[node-asyncify]: https://github.com/jden/nodeAsyncify\n\n\nInstallation\n============\n\n`npm install simple-asyncify`\n\n```js\nvar asyncify = require(\"simple-asyncify\")\n```\n\n\nUsage\n=====\n\n### `asyncify(syncFn)` ###\n\nReturns an async function that accepts the same arguments as `syncFn` plus a\ncallback. It runs `syncFn` with the arguments. If `syncFn` throws an error, the\ncallback is invoked with that error. Otherwise the callback is invoked with\n`null` and the return value of `syncFn`.\n\n`setImmediate` is used to make the function async.\n\n\nLicense\n=======\n\n[The X11 (“MIT”) License](LICENSE).\n","maintainers":[{"name":"lydell","email":"simon.lydell@gmail.com"}],"time":{"modified":"2022-06-26T19:31:16.441Z","created":"2014-03-03T19:40:22.516Z","0.1.0":"2014-03-03T19:40:22.516Z","1.0.0":"2015-08-22T07:28:03.730Z"},"homepage":"https://github.com/lydell/simple-asyncify#readme","keywords":["async","asyncify","callback"],"repository":{"type":"git","url":"git+https://github.com/lydell/simple-asyncify.git"},"author":{"name":"Simon Lydell"},"bugs":{"url":"https://github.com/lydell/simple-asyncify/issues"},"license":"MIT","readmeFilename":"readme.md"}