{"_id":"p-call","_rev":"1-4ec2e98d9dcfca2ec0c0c90678afff76","name":"p-call","description":"Call a legacy async method and return a promise","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"p-call","version":"1.0.0","description":"Call a legacy async method and return a promise","main":"index.js","files":["index.js"],"scripts":{"test":"jest"},"devDependencies":{"jest":"^21.2.1"},"author":{"name":"Matthew Francis Brunetti","email":"zenflow87@gmail.com"},"repository":{"type":"git","url":"git+https://zenflow@github.com/zenflow/p-call.git"},"bugs":{"url":"https://github.com/zenflow/p-call/issues"},"homepage":"https://github.com/zenflow/p-call#readme","license":"MIT","gitHead":"6ca89008eb0c4f54ef2ede5dc1f83f9dfc34bfb7","_id":"p-call@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"zen_flow","email":"zenflow87@gmail.com"},"dist":{"integrity":"sha512-r6a55ipuKGJN0bWHFVdefM2iKZkOYJz6AL/zCXQ201slI9Mk4a4KYMtnWjUBLLBVVOk+kX/3LplzGpLHtSBfCg==","shasum":"3e7df53f9df919444ba94d8727ee6b5d1494d727","tarball":"https://registry.npmjs.org/p-call/-/p-call-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdZ3fSp7Xhqx+yUCqHqpXXC5ni+7aLrn7jVkx9NRkLAgIgXrygH0UOg2W55CFJ9fIp686bGdHemBCXTZEp0RuxusE="}]},"maintainers":[{"name":"zen_flow","email":"zenflow87@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-call-1.0.0.tgz_1513379510074_0.3717890768311918"}}},"readme":"# p-call\r\nCall a legacy async method and return a promise\r\n\r\nVery similar to [promisify-call](https://github.com/bojand/promisify-call) but always promisifies the call, rather than guessing if it should.\r\n\r\n---\r\n\r\n### Example\r\n\r\nInstead of using the legacy error-first callback API ...\r\n\r\n```js\r\nobject.method(argument, (error, result) => {\r\n  if (error) {\r\n    throw error\r\n  }\r\n  console.log(result)\r\n})\r\n```\r\n\r\nUse the Promise API ...\r\n\r\n```js\r\nconst result = await pCall(object, object.method, argument)\r\nconsole.log(result)\r\n\r\n// Or, specify the function as a property key of `object`...\r\nconst result = await pCall(object, 'method', argument)\r\nconsole.log(result)\r\n```\r\n","maintainers":[{"name":"zen_flow","email":"zenflow87@gmail.com"}],"time":{"modified":"2022-05-12T10:27:12.094Z","created":"2017-12-15T23:11:51.049Z","1.0.0":"2017-12-15T23:11:51.049Z"},"homepage":"https://github.com/zenflow/p-call#readme","repository":{"type":"git","url":"git+https://zenflow@github.com/zenflow/p-call.git"},"author":{"name":"Matthew Francis Brunetti","email":"zenflow87@gmail.com"},"bugs":{"url":"https://github.com/zenflow/p-call/issues"},"license":"MIT","readmeFilename":"README.md"}