Comparing version 0.5.3 to 0.6.0
@@ -0,1 +1,16 @@ | ||
# [0.6.0](https://github.com/rafamel/promist/compare/v0.5.3...v0.6.0) (2019-05-12) | ||
### Features | ||
* **compose:** adds second argument (create) for compose functions ([344fcd7](https://github.com/rafamel/promist/commit/344fcd7)) | ||
* **helpers:** adds asNew() ([e5921c6](https://github.com/rafamel/promist/commit/e5921c6)) | ||
* **helpers:** adds helpers index w/ named exports ([20c433c](https://github.com/rafamel/promist/commit/20c433c)) | ||
* **types:** defines statuses as literals instead of enums ([c6e9c50](https://github.com/rafamel/promist/commit/c6e9c50)) | ||
* exports types from entry point ([a47f043](https://github.com/rafamel/promist/commit/a47f043)) | ||
* **utils/compose:** adds create argument to compose; improves typings ([a051a63](https://github.com/rafamel/promist/commit/a051a63)) | ||
* **utils/is-promise:** adds type guard to isPromise ([70d3e62](https://github.com/rafamel/promist/commit/70d3e62)) | ||
## [0.5.3](https://github.com/rafamel/promist/compare/v0.5.2...v0.5.3) (2019-02-24) | ||
@@ -2,0 +17,0 @@ |
131
package.json
{ | ||
"name": "promist", | ||
"version": "0.5.3", | ||
"author": "Rafa Mel", | ||
"description": "A dependable Promises and async utility belt", | ||
"description": "A dependable promises and async utility belt", | ||
"version": "0.6.0", | ||
"license": "MIT", | ||
"files": [ | ||
"dist-*/", | ||
"bin/" | ||
], | ||
"esnext": "dist-src/index.js", | ||
"main": "dist-node/index.js", | ||
"module": "dist-web/index.js", | ||
"pika": true, | ||
"sideEffects": false, | ||
"keywords": [ | ||
@@ -19,31 +28,6 @@ "async", | ||
], | ||
"scripts": { | ||
"preversion": "nps private.preversion", | ||
"version": "nps private.version", | ||
"start": "npm run watch", | ||
"build": "nps build", | ||
"build:prepare": "nps build.prepare", | ||
"build:transpile": "nps build.transpile", | ||
"build:declaration": "nps build.declaration", | ||
"watch": "nps watch", | ||
"fix": "nps fix", | ||
"fix:format": "nps fix.format", | ||
"fix:md": "nps fix.md", | ||
"types": "nps types", | ||
"lint": "nps lint", | ||
"lint:md": "nps lint.md", | ||
"lint:scripts": "nps lint.scripts", | ||
"test": "nps test", | ||
"test:watch": "nps test.watch", | ||
"validate": "nps validate", | ||
"docs": "nps docs", | ||
"changelog": "nps changelog", | ||
"update": "nps update", | ||
"clean": "nps clean", | ||
"nps": "nps", | ||
"jake": "jake", | ||
"commit": "cross-env COMMITIZEN=# git-cz" | ||
"homepage": "https://github.com/rafamel/promist", | ||
"bugs": { | ||
"url": "https://github.com/rafamel/promist/issues" | ||
}, | ||
"license": "MIT", | ||
"homepage": "https://github.com/rafamel/promist", | ||
"repository": { | ||
@@ -53,65 +37,54 @@ "type": "git", | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/rafamel/promist/issues" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0", | ||
"@babel/core": "^7.3.3", | ||
"@babel/plugin-proposal-class-properties": "^7.3.3", | ||
"@babel/plugin-proposal-decorators": "^7.2.2", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.3.2", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/cli": "^7.4.4", | ||
"@babel/core": "^7.4.4", | ||
"@babel/plugin-proposal-class-properties": "^7.4.4", | ||
"@babel/plugin-proposal-decorators": "^7.4.4", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.4.4", | ||
"@babel/preset-env": "^7.4.4", | ||
"@babel/preset-typescript": "^7.3.3", | ||
"@types/jest": "^24.0.6", | ||
"@typescript-eslint/eslint-plugin": "^1.4.1", | ||
"@typescript-eslint/parser": "^1.4.1", | ||
"@zerollup/ts-transform-paths": "^1.7.0", | ||
"@pika/pack": "^0.3.7", | ||
"@pika/plugin-build-node": "^0.3.16", | ||
"@pika/plugin-build-web": "^0.3.16", | ||
"@pika/plugin-standard-pkg": "^0.3.16", | ||
"@types/jest": "^24.0.12", | ||
"@typescript-eslint/eslint-plugin": "^1.7.0", | ||
"@typescript-eslint/parser": "^1.7.0", | ||
"@zerollup/ts-transform-paths": "^1.7.1", | ||
"babel-eslint": "^10.0.1", | ||
"babel-jest": "^24.1.0", | ||
"babel-jest": "^24.8.0", | ||
"babel-plugin-module-resolver": "^3.2.0", | ||
"commitizen": "^3.0.7", | ||
"concurrently": "^4.1.0", | ||
"conventional-changelog-cli": "^2.0.12", | ||
"conventional-recommended-bump": "^4.0.4", | ||
"commitizen": "^3.1.1", | ||
"conventional-changelog-cli": "^2.0.21", | ||
"conventional-recommended-bump": "^5.0.0", | ||
"coveralls": "^3.0.3", | ||
"cross-env": "^5.2.0", | ||
"cz-conventional-changelog": "^2.1.0", | ||
"eslint": "^5.14.1", | ||
"eslint-config-prettier": "^4.0.0", | ||
"eslint": "^5.16.0", | ||
"eslint-config-prettier": "^4.2.0", | ||
"eslint-config-standard": "^12.0.0", | ||
"eslint-import-resolver-babel-module": "^5.0.1", | ||
"eslint-import-resolver-typescript": "^1.1.1", | ||
"eslint-import-resolver-alias": "^1.1.2", | ||
"eslint-plugin-babel": "^5.3.0", | ||
"eslint-plugin-import": "^2.16.0", | ||
"eslint-plugin-jest": "^22.3.0", | ||
"eslint-plugin-node": "^8.0.0", | ||
"eslint-plugin-prettier": "^3.0.0", | ||
"eslint-plugin-promise": "^4.0.1", | ||
"eslint-plugin-import": "^2.17.2", | ||
"eslint-plugin-jest": "^22.5.1", | ||
"eslint-plugin-node": "^9.0.0", | ||
"eslint-plugin-prettier": "^3.0.1", | ||
"eslint-plugin-promise": "^4.1.1", | ||
"eslint-plugin-standard": "^4.0.0", | ||
"eslint-restricted-globals": "^0.2.0", | ||
"husky": "1.3.0", | ||
"jake": "^8.0.19", | ||
"jest-cli": "^24.1.0", | ||
"markdown-spellcheck": "^1.3.1", | ||
"markdownlint-cli": "^0.13.0", | ||
"nps": "^5.9.4", | ||
"husky": "^2.2.0", | ||
"jest-cli": "^24.8.0", | ||
"kpo": "^0.5.1", | ||
"markdownlint-cli": "^0.16.0", | ||
"onchange": "^5.2.0", | ||
"prettier": "^1.16.4", | ||
"shx": "^0.3.2", | ||
"prettier": "^1.17.0", | ||
"slimconf": "^0.9.0", | ||
"ttypescript": "^1.5.6", | ||
"typedoc": "^0.14.2", | ||
"typescript": "^3.3.3333" | ||
"typescript": "3.4.5" | ||
}, | ||
"dependencies": {}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "cross-env COMMIT=# nps validate" | ||
} | ||
"engines": { | ||
"node": ">=8" | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "cz-conventional-changelog" | ||
} | ||
}, | ||
"main": "./index.js" | ||
"types": "dist-types/index.d.ts" | ||
} |
# Promist | ||
[![Version](https://img.shields.io/npm/v/promist.svg)](https://www.npmjs.com/package/promist) | ||
[![Build Status](https://img.shields.io/travis/rafamel/promist.svg)](https://travis-ci.org/rafamel/promist) | ||
[![Coverage](https://img.shields.io/coveralls/rafamel/promist.svg)](https://coveralls.io/github/rafamel/promist) | ||
[![Build Status](https://img.shields.io/travis/rafamel/promist/master.svg)](https://travis-ci.org/rafamel/promist) | ||
[![Coverage](https://img.shields.io/coveralls/rafamel/promist/master.svg)](https://coveralls.io/github/rafamel/promist) | ||
[![Dependencies](https://img.shields.io/david/rafamel/promist.svg)](https://david-dm.org/rafamel/promist) | ||
[![Vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/promist.svg)](https://snyk.io/test/npm/promist) | ||
[![License](https://img.shields.io/github/license/rafamel/promist.svg)](https://github.com/rafamel/promist/blob/master/LICENSE) | ||
[![Types](https://img.shields.io/npm/types/exits.svg)](https://www.npmjs.com/package/exits) | ||
[![Types](https://img.shields.io/npm/types/promist.svg)](https://www.npmjs.com/package/promist) | ||
<!-- markdownlint-disable MD036 --> | ||
**A dependable Promises and async utility belt.** Not a `Promise` implementation. | ||
<!-- markdownlint-enable MD036 --> | ||
> A dependable promises and async utility belt. Not a `Promise` implementation. | ||
If you find it useful, consider [starring the project](https://github.com/rafamel/promist) 💪 and/or following [its author](https://github.com/rafamel) ❤️ -there's more on the way! | ||
## Install | ||
@@ -47,12 +47,2 @@ | ||
You can either `import` directly from the package root (as shown in the examples below), or: | ||
```javascript | ||
import { /* create functions to import */ } from 'promist/create'; | ||
import { /* compose functions to import */ } from 'promist/compose'; | ||
import { /* utils to import */ } from 'promist/utils'; | ||
import parallel, { /* or the parallel function to import */ } from 'promist/parallel'; | ||
import series, { /* or the series function to import */ } from 'promist/series'; | ||
``` | ||
## Promises | ||
@@ -139,6 +129,7 @@ | ||
* They can optionally return a newly created promise: they take a second `create` argument -`false` by default. | ||
* They might not work adequately if you're using non-standard methods for resolution other than `promise.then()`, `promise.catch()`, or `promise.finally()`. | ||
* They can be chained via [`compose()`.](#composefns-function) | ||
#### `deferrable(promise: Promise): Promise` | ||
#### `deferrable(promise: Promise, create?: boolean): Promise` | ||
@@ -165,3 +156,3 @@ * `promise` will acquire: | ||
#### `cancellable(promise: Promise): Promise` | ||
#### `cancellable(promise: Promise, create?: boolean): Promise` | ||
@@ -181,3 +172,3 @@ * `promise` will acquire: | ||
#### `status(promise: Promise): Promise` | ||
#### `status(promise: Promise, create?: boolean): Promise` | ||
@@ -195,3 +186,3 @@ * `promise` will acquire: | ||
#### `timed(promise: Promise): Promise` | ||
#### `timed(promise: Promise, create?: boolean): Promise` | ||
@@ -212,3 +203,3 @@ * `promise` will acquire: | ||
Returns a function with signature: `(promise: Promise): Promise`. | ||
Returns a function with signature: `(promise: Promise, create?: boolean): Promise`. | ||
@@ -235,3 +226,3 @@ The returned promise will acquire a lower threshold in `ms` for promise resolution. If the original `promise` resolves before `ms`, the returned promise won't resolve until `ms` have passed; if it resolves after, it will resolve immediately. The count starts the moment `delay()()` is called. | ||
Returns a function with signature: `(promise: Promise): Promise`. | ||
Returns a function with signature: `(promise: Promise, create?: boolean): Promise`. | ||
@@ -251,3 +242,3 @@ The returned promise will acquire an upper threshold in `ms` after which, if it hasn't fulfilled, it will either cancel or reject, depending on whether a `reason` argument was passed. The count starts the moment `timeout()()` is called. | ||
Takes in an unlimited number of *compose* functions as arguments, and returns a function that should receive the promise to mutate. | ||
Takes in an unlimited number of *compose* functions as arguments, and returns a function with signature: `(promise: Promise, create?: boolean): Promise`. | ||
@@ -260,3 +251,3 @@ ```javascript | ||
#### `control(test: function, generator: function): function` | ||
#### `control(test: Function, generator: Function): Function` | ||
@@ -293,3 +284,3 @@ Used to control async flow. It returns a promise returning function taking the same arguments as `generator`. | ||
#### `isPromise(object: any): boolean` | ||
#### `isPromise(item: any): boolean` | ||
@@ -349,2 +340,2 @@ Returns `true` if `object` is a *thenable,* `false` otherwise. | ||
* `arr`: An array of promises. | ||
* `callback`: With the same signature as [`Array.prototype.forEach()`.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) Can be a promise returning/*async* function. | ||
* `callback`: With the same signature as [`Array.prototype.forEach()`.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) Can be a promise returning/*async* function. |
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
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
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
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
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
45
56
983
53362
1
331