cb-to-promise
Advanced tools
Comparing version 0.0.1 to 1.0.0
{ | ||
"name": "cb-to-promise", | ||
"version": "0.0.1", | ||
"description": "Takes in a node-convential function that has args and a callback and returns a promise", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/maxnachlinger/cb-to-promise.git" | ||
"url": "git+https://github.com/npm/deprecate-holder.git" | ||
}, | ||
"scripts": { | ||
"test": "standard && node_modules/.bin/tape tests.js" | ||
"author": "", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/npm/deprecate-holder/issues" | ||
}, | ||
"author": "Max Nachlinger", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"standard": "^6.0.8", | ||
"tape": "^4.5.1" | ||
} | ||
"homepage": "https://github.com/npm/deprecate-holder#readme" | ||
} |
@@ -1,56 +0,5 @@ | ||
# cb-to-promise | ||
# Deprecated Package | ||
Takes in a node-conventional function that has args and a callback and returns a promise | ||
This package is no longer supported and has been deprecated. To avoid malicious use, npm is hanging on to the package name. | ||
[![travis][travis-image]][travis-url] | ||
[![npm][npm-image]][npm-url] | ||
[![standard][standard-image]][standard-url] | ||
[travis-image]: https://travis-ci.org/maxnachlinger/cb-to-promise.svg?branch=master | ||
[travis-url]: https://travis-ci.org/maxnachlinger/cb-to-promise | ||
[npm-image]: https://img.shields.io/npm/v/cb-to-promise.svg?style=flat | ||
[npm-url]: https://npmjs.org/package/cb-to-promise | ||
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg | ||
[standard-url]: http://standardjs.com/ | ||
### Installation: | ||
``` | ||
npm i cb-to-promise --save | ||
``` | ||
### Basic Examples | ||
```javascript | ||
'use strict' | ||
const fx = (cb) => cb() | ||
cbToPromise(fx)() | ||
.then(result => /*no result since callback wasn't called with anything*/) | ||
const fx1 = (cb) => cb(new Error('test error')) | ||
cbToPromise(fx1)() | ||
.catch((err) => { | ||
// promise rejected since callback called with an Error | ||
}) | ||
const fx2 = (cb) => cb(null, 'some-result') | ||
cbToPromise(fx2)() | ||
.then((result) => /*'some-result'*/) | ||
}) | ||
const fx3 = (cb) => cb(null, 'some-result0', 'some-result1') | ||
// N non error callback args are returned in an array | ||
cbToPromise(fx3)() | ||
.then((results) => /*['some-result0', 'some-result1]*/) | ||
}) | ||
const fx4 = (arg0, arg1, cb) => cb(null, 'some-result0', 'some-result1') | ||
// N non error callback args are returned in an array | ||
cbToPromise(fx4)('some arg', 'another arg') | ||
.then((results) => /*['some-result0', 'some-result1]*/) | ||
}) | ||
``` | ||
Please contact support@npmjs.com if you have questions about this package. |
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
1
675
2
0
6
2