diff --git a/README.md b/README.md index dd3b570..0f5f095 100644 --- a/README.md +++ b/README.md @@ -142,15 +142,15 @@ __Example__ import fs from 'fs'; import presage from 'presage'; -const pStats = file => new Promise((resolve, reject) => { - fs.stat(file, (error, stats) => { - if (error) { - reject(error); - } else { - resolve(stats); - } - }); -}); +const pState = file => { + const { + callbackFunction, + promise + } = presage.promiseWithCallback(); + + fs.stat(file, callbackFunction); + return promise; +} presage.map([ 'file1', @@ -343,7 +343,7 @@ const pReadFile = (path, options) => { promise } = presage.promiseWithCallback(); - fs.readFile(filename, options, callbackFunction); + fs.readFile(path, options, callbackFunction); return promise; }; diff --git a/package.json b/package.json index 82efd1e..5bf7f2e 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "build": "BABEL_ENV=build babel js -d lib", "coverage": "babel-node ./node_modules/.bin/babel-istanbul cover _mocha --report lcovonly -- -R spec", "lint": "node_modules/.bin/eslint js", - "posttest": "[ -z \"$npm_config_coverage\" ] || babel-istanbul check-coverage --branches 80 --functions 100 --lines 95 --statements 95", + "posttest": "[ -z \"$npm_config_coverage\" ] || babel-istanbul check-coverage --branches 80 --functions 100 --lines 100 --statements 100", "prepare": "npm run build", "prepublishOnly": "npm run securityCheck && npm test --coverage", "pretest": "npm run lint", @@ -65,5 +65,5 @@ "start": "node lib/index.js", "test": "babel-node ./node_modules/.bin/babel-istanbul test _mocha" }, - "version": "0.1.0" + "version": "0.1.2" }