extrinsic-promises
Advanced tools
Comparing version 2.2.0 to 2.2.1
{ | ||
"name": "extrinsic-promises", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "A convenient promises anti-pattern: promises you can settle from outside the promise.", | ||
@@ -13,31 +13,17 @@ "keywords": [ | ||
"files": [ | ||
"dist/src/index.js" | ||
"src/index.js" | ||
], | ||
"main": "dist/src/index.js", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"clean": "rimraf coverage/ .nyc_output/ dist/", | ||
"check:lint:ci:yaml": "yamllint .travis.yml", | ||
"check:lint:ci": "npm-run-all --parallel check:lint:ci:*", | ||
"check:lint:changes": "yamllint CHANGES.yaml", | ||
"check:lint:readme:markdown": "remark --no-stdout README.md", | ||
"check:lint:readme": "npm-run-all --parallel check:lint:readme:*", | ||
"check:lint:js:root": "standard ./*.js | snazzy", | ||
"check:lint:js:src": "standard src/**/*.js | snazzy", | ||
"check:lint:js:test": "standard test/**/*.js | snazzy", | ||
"check:lint:js:npmpackagejsonlint-config": "standard ./npmpackagejsonlint.config.js | snazzy", | ||
"check:lint:js:stryker-config": "standard ./stryker.conf.js | snazzy", | ||
"check:lint:js": "npm-run-all --parallel check:lint:js:*", | ||
"check:lint:package-json": "pjl-cli", | ||
"check:lint": "npm-run-all --parallel check:lint:*", | ||
"check": "npm-run-all --parallel check:*", | ||
"check:ci": "yamllint .travis.yml", | ||
"check:changes": "yamllint CHANGES.yaml", | ||
"check:readme": "remark --no-stdout README.md", | ||
"check:js": "eslint --max-warnings 0 --no-error-on-unmatched-pattern --format codeframe ./stryker.conf.js src/ test/ \"./*.js\"", | ||
"check": "npm-run-all check:*", | ||
"test": "nyc mocha ./test/src/**/*.spec.js", | ||
"verify": "npm-run-all check test", | ||
"mutation-test": "stryker run", | ||
"compile-prod:app": "babel src/ --out-dir dist/src/", | ||
"compile-dev:app": "babel src/ --out-dir dist/src/ --plugins node-source-map-support --source-maps inline", | ||
"compile-dev:test": "babel test/ --out-dir dist/test/ --plugins node-source-map-support --source-maps inline", | ||
"compile:nop": "echo \"there are no common compile tasks defined, no problem.\"", | ||
"compile-prod": "npm-run-all compile-prod:* compile:*", | ||
"compile-dev": "npm-run-all compile-dev:* compile:*", | ||
"compile": "if-env NODE_ENV=production && npm run compile-prod || npm run compile-dev", | ||
"compile": "echo \"Nothing to compile, babel has been removed: OK.\"", | ||
"ci-best": "./dev-scripts/choose-ci.sh", | ||
"build": "npm-run-all clean compile verify", | ||
@@ -56,3 +42,3 @@ "prepublishOnly": "cross-env NODE_ENV=production npm run build" | ||
"engines": { | ||
"node": ">6.0.0 <12" | ||
"node": ">=6.0.0 <16" | ||
}, | ||
@@ -65,5 +51,2 @@ "license": "MIT", | ||
], | ||
"require": [ | ||
"babel-core/register" | ||
], | ||
"include": [ | ||
@@ -80,36 +63,26 @@ "src/**" | ||
"devDependencies": { | ||
"babel-cli": "6.26.0", | ||
"babel-eslint": "8.0.1", | ||
"babel-plugin-node-source-map-support": "0.0.1", | ||
"babel-plugin-transform-object-assign": "6.22.0", | ||
"babel-plugin-transform-object-rest-spread": "6.26.0", | ||
"babel-preset-env": "1.7.0", | ||
"chai": "4.2.0", | ||
"chai": "4.3.4", | ||
"chai-as-promised": "7.1.1", | ||
"copyfiles": "1.2.0", | ||
"cross-env": "5.2.0", | ||
"if-env": "1.0.0", | ||
"lfsr": "0.0.3", | ||
"mocha": "5.2.0", | ||
"npm-package-json-lint": "2.11.0", | ||
"npm-run-all": "4.1.1", | ||
"nyc": "14.1.1", | ||
"ramda": "0.25.0", | ||
"remark-cli": "7.0.0", | ||
"rimraf": "2.6.2", | ||
"sinon": "7.2.2", | ||
"sinon-chai": "3.3.0", | ||
"snazzy": "7.0.0", | ||
"source-map-support": "0.5.9", | ||
"standard": "10.0.3", | ||
"stryker": "0.33.2", | ||
"stryker-api": "0.22.1", | ||
"stryker-babel-transpiler": "0.7.11", | ||
"cross-env": "7.0.3", | ||
"eslint": "7.23.0", | ||
"eslint-config-mearns": "git+https://github.com/mearns/eslint-config-mearns.git#v0.3.0", | ||
"mocha": "8.3.2", | ||
"npm-run-all": "4.1.5", | ||
"nyc": "15.1.0", | ||
"prettier": "1.19.1", | ||
"pretty-quick": "3.1.0", | ||
"remark-cli": "9.0.0", | ||
"rimraf": "3.0.2", | ||
"sinon": "10.0.0", | ||
"sinon-chai": "3.6.0", | ||
"stryker": "0.35.1", | ||
"stryker-api": "0.24.1", | ||
"stryker-baseline-reporter": "1.0.3", | ||
"stryker-html-reporter": "0.16.10", | ||
"stryker-javascript-mutator": "0.12.2", | ||
"stryker-mocha-framework": "0.13.3", | ||
"stryker-mocha-runner": "0.15.3", | ||
"yaml-lint": "1.0.0" | ||
} | ||
"stryker-html-reporter": "0.18.1", | ||
"stryker-javascript-mutator": "0.14.1", | ||
"stryker-mocha-framework": "0.15.1", | ||
"stryker-mocha-runner": "0.17.1", | ||
"yaml-lint": "1.2.4" | ||
}, | ||
"dependencies": {} | ||
} |
@@ -6,2 +6,4 @@ [![Build Status](https://travis-ci.org/mearns/extrinsic-promises.svg?branch=master)](https://travis-ci.org/mearns/extrinsic-promises) | ||
_Supports node versions back to v6, and 0 runtime dependencies_ | ||
`extrinsic-promises` is a JavaScript module that provides a convenient promises anti-pattern | ||
@@ -30,13 +32,13 @@ for those times when you just really need to settle (fulfill or reject) your promise from | ||
```javascript | ||
import ExtrinsicPromise from 'extrinsic-promises' | ||
import ExtrinsicPromise from "extrinsic-promises"; | ||
const promise = new ExtrinsicPromise() | ||
const promise = new ExtrinsicPromise(); | ||
// Setup handlers for the promise, just like you normally would. | ||
promise.then((value) => { | ||
console.log('Promise was fulfilled with value:', value) | ||
}) | ||
promise.then(value => { | ||
console.log("Promise was fulfilled with value:", value); | ||
}); | ||
// Call the public methods on the promise to fulfill/resolve it. | ||
promise.fulfill('Some value') | ||
promise.fulfill("Some value"); | ||
``` | ||
@@ -47,12 +49,12 @@ | ||
```javascript | ||
const promise = new ExtrinsicPromise() | ||
const promise = new ExtrinsicPromise(); | ||
// Register your on-reject handler for the promise, | ||
// just like you normally would. | ||
promise.then(null, (reason) => { | ||
console.log('Promise was reject for reason:', reason) | ||
}) | ||
promise.then(null, reason => { | ||
console.log("Promise was reject for reason:", reason); | ||
}); | ||
// Call the public methods on the promise to reject it. | ||
promise.reject(new Error('some reason')) | ||
promise.reject(new Error("some reason")); | ||
``` | ||
@@ -67,7 +69,7 @@ | ||
```javascript | ||
import Promise from 'bluebird' | ||
import ExtrinsicPromise from 'extrinsic-promises' | ||
import Promise from "bluebird"; | ||
import ExtrinsicPromise from "extrinsic-promises"; | ||
const exPromise = new ExtrinsicPromise() | ||
const bluebirdPromise = Promise.fulfill(exPromise) | ||
const exPromise = new ExtrinsicPromise(); | ||
const bluebirdPromise = Promise.fulfill(exPromise); | ||
``` | ||
@@ -79,8 +81,8 @@ | ||
```javascript | ||
import ExtrinsicPromise from 'extrinsic-promises' | ||
import ExtrinsicPromise from "extrinsic-promises"; | ||
const exPromise = new ExtrinsicPromise() | ||
const exPromise = new ExtrinsicPromise(); | ||
const otherPromise = new Promise((fulfill, reject) => { | ||
exPromise.then(fulfill, reject) | ||
}) | ||
exPromise.then(fulfill, reject); | ||
}); | ||
``` | ||
@@ -105,6 +107,6 @@ | ||
```javascript | ||
const exPromise = new ExtrinsicPromise() | ||
const fulfillLater = exPromise.fulfill | ||
const exPromise = new ExtrinsicPromise(); | ||
const fulfillLater = exPromise.fulfill; | ||
// ... | ||
fulfillLater(value) // correctly fulfills exPromise. | ||
fulfillLater(value); // correctly fulfills exPromise. | ||
``` | ||
@@ -120,6 +122,6 @@ | ||
```javascript | ||
const exPromise = new ExtrinsicPromise() | ||
const rejectLater = exPromise.reject | ||
const exPromise = new ExtrinsicPromise(); | ||
const rejectLater = exPromise.reject; | ||
// ... | ||
rejectLater(reason) // correctly rejects exPromise. | ||
rejectLater(reason); // correctly rejects exPromise. | ||
``` | ||
@@ -134,4 +136,4 @@ | ||
```javascript | ||
const exPromise = new ExtrinsicPromise() | ||
thennable.then(exPromise.fulfill, exPromise.reject) | ||
const exPromise = new ExtrinsicPromise(); | ||
thennable.then(exPromise.fulfill, exPromise.reject); | ||
``` | ||
@@ -138,0 +140,0 @@ |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22
110
169
21041
1