Comparing version 0.1.0 to 1.0.0
12
index.js
@@ -1,2 +0,2 @@ | ||
module.exports = function (fn){ | ||
module.exports = function(fn){ | ||
return function(obj, cb){ | ||
@@ -6,4 +6,4 @@ if(cb && cb instanceof Function){ | ||
} else { | ||
return new Promise((resolve, reject)=>{ | ||
fn(obj, (err, res)=>{ | ||
return new Promise((resolve, reject) => { | ||
fn(obj, (err, res) => { | ||
if(err){ | ||
@@ -15,5 +15,5 @@ reject(err); | ||
}); | ||
}) | ||
}); | ||
} | ||
} | ||
} | ||
}; | ||
}; |
{ | ||
"name": "promy", | ||
"version": "0.1.0", | ||
"version": "1.0.0", | ||
"description": "Conditional promisify", | ||
"main": "index.js", | ||
"author": "astur <astur@yandex.ru> (http://kozlov.am/)", | ||
"scripts": { | ||
"test": "eslint . && nyc ava -v" | ||
}, | ||
"repository": { | ||
@@ -10,2 +14,11 @@ "type": "git", | ||
}, | ||
"engines": { | ||
"node": ">=8.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.25.0", | ||
"eslint": "^4.19.1", | ||
"eslint-config-astur": "0.0.2", | ||
"nyc": "^12.0.2" | ||
}, | ||
"keywords": [ | ||
@@ -17,4 +30,3 @@ "promisify", | ||
], | ||
"author": "astur <astur@yandex.ru> (http://kozlov.am/)", | ||
"license": "MIT" | ||
} | ||
} |
@@ -5,2 +5,6 @@ # promy | ||
[![Build Status][travis-image]][travis-url] | ||
[![NPM version][npm-image]][npm-url] | ||
## Install | ||
@@ -14,3 +18,3 @@ | ||
It works like easy old good promisify, so if you have some async callback-based function you can do something like this: | ||
If you have some async function getting calback as second parameter you can do something like this: | ||
@@ -43,2 +47,7 @@ ```js | ||
MIT | ||
MIT | ||
[npm-url]: https://npmjs.org/package/promy | ||
[npm-image]: https://badge.fury.io/js/promy.svg | ||
[travis-url]: https://travis-ci.org/astur/promy | ||
[travis-image]: https://travis-ci.org/astur/promy.svg?branch=master |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
4012
8
41
1
50
4