@jcoreio/async-throttle
Advanced tools
Comparing version 1.1.2 to 1.2.0
@@ -22,2 +22,1 @@ The MIT License (MIT) | ||
SOFTWARE. | ||
112
package.json
{ | ||
"name": "@jcoreio/async-throttle", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "throttle async and promise-returning functions. Other packages don't do it right.", | ||
"main": "lib/index.js", | ||
"main": "index.js", | ||
"sideEffects": false, | ||
"files": [ | ||
"index.js", | ||
"index.js.flow" | ||
], | ||
"scripts": { | ||
@@ -10,19 +15,42 @@ "lint": "eslint src test --cache", | ||
"lint:watch": "esw --watch src test --cache", | ||
"prettier": "prettier --write *.json *.md *.js '{src,test}/**/*.js'", | ||
"prettier:check": "prettier --list-different *.json *.md *.js '{src,test}/**/*.js'", | ||
"flow": "flow", | ||
"flow:coverage": "for file in src/**.js test/**.js; do echo $file; flow coverage $file; done", | ||
"flow:watch": "flow-watch -e js,js.flow,flowconfig --ignore lib/ --ignore node_modules/ --watch .flowconfig --watch src/ --watch test/", | ||
"build": "rimraf lib && babel src --out-dir lib && flow-copy-source -v src/ lib", | ||
"test": "NODE_ENV=production BABEL_ENV=test nyc --reporter=lcov --reporter=text mocha $npm_package_config_mocha", | ||
"test:watch": "mocha --watch $npm_package_config_mocha", | ||
"flow:watch": "flow-watch -e js,js.flow,flowconfig --ignore es/ --ignore node_modules/ --watch .flowconfig --watch src/ --watch test/", | ||
"clean": "rimraf es lib $(cd src; ls) *.js.flow", | ||
"build": "npm run clean && babel src --out-dir es && flow-copy-source -v src/ es && cross-env BABEL_ENV=es5 babel src --out-dir . && flow-copy-source -v src/ .", | ||
"test": "cross-env NODE_ENV=test BABEL_ENV=es5 mocha $npm_package_config_mocha && cross-env NODE_ENV=test BABEL_ENV=coverage nyc --reporter=lcov --reporter=text mocha $npm_package_config_mocha", | ||
"test:watch": "cross-env NODE_ENV=test BABEL_ENV=test mocha --watch $npm_package_config_mocha", | ||
"test:debug": "cross-env NODE_ENV=test BABEL_ENV=test mocha --inspect-brk $npm_package_config_mocha", | ||
"codecov": "nyc report --reporter=text-lcov > coverage.lcov; codecov", | ||
"commitmsg": "commitlint -e $GIT_PARAMS", | ||
"precommit": "npm run lint && flow", | ||
"prepush": "npm test", | ||
"prepublishOnly": "npm run lint && flow && npm test && npm run build", | ||
"prepublishOnly": "npm run clean && npm run prettier:check && npm run lint && flow && npm test && npm run build", | ||
"open:coverage": "open coverage/lcov-report/index.html", | ||
"semantic-release": "semantic-release", | ||
"travis-deploy-once": "travis-deploy-once" | ||
"semantic-release": "semantic-release" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged && npm run lint && flow", | ||
"commit-msg": "commitlint -e $GIT_PARAMS", | ||
"pre-push": "npm test" | ||
} | ||
}, | ||
"lint-staged": { | ||
"*.{js,json,css,md}": [ | ||
"prettier --write", | ||
"git add" | ||
] | ||
}, | ||
"commitlint": { | ||
"extends": [ | ||
"@jedwards1211/commitlint-config" | ||
] | ||
}, | ||
"prettier": { | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
}, | ||
"config": { | ||
"mocha": "-r babel-register ./test/**/*.js", | ||
"mocha": "-r @babel/register test/configure.js 'test/**/*.js'", | ||
"commitizen": { | ||
@@ -37,3 +65,3 @@ "path": "cz-conventional-changelog" | ||
"require": [ | ||
"babel-register" | ||
"@babel/register" | ||
], | ||
@@ -60,2 +88,8 @@ "sourceMap": false, | ||
"devDependencies": { | ||
"@babel/cli": "^7.1.5", | ||
"@babel/core": "^7.1.6", | ||
"@babel/plugin-transform-runtime": "^7.1.0", | ||
"@babel/preset-env": "^7.1.6", | ||
"@babel/preset-flow": "^7.0.0", | ||
"@babel/register": "^7.0.0", | ||
"@commitlint/cli": "^6.0.2", | ||
@@ -65,31 +99,31 @@ "@commitlint/config-conventional": "^6.0.2", | ||
"@jedwards1211/eslint-config": "^2.0.0", | ||
"@jedwards1211/eslint-config-flow": "^1.0.0", | ||
"babel-cli": "^6.23.0", | ||
"babel-core": "^6.23.1", | ||
"babel-eslint": "^7.1.1", | ||
"babel-plugin-istanbul": "^4.0.0", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"babel-preset-es2015": "^6.22.0", | ||
"babel-preset-flow": "^6.23.0", | ||
"babel-preset-stage-1": "^6.22.0", | ||
"babel-register": "^6.23.0", | ||
"babel-runtime": "^6.23.0", | ||
"chai": "^4.1.2", | ||
"codecov": "^3.0.0", | ||
"copy": "^0.3.0", | ||
"eslint": "^3.15.0", | ||
"eslint-plugin-flowtype": "^2.30.0", | ||
"eslint-watch": "^3.0.0", | ||
"flow-bin": "^0.72.0", | ||
"flow-copy-source": "^1.2.1", | ||
"flow-watch": "^1.1.0", | ||
"husky": "^0.14.3", | ||
"@jedwards1211/eslint-config-flow": "^2.0.0", | ||
"babel-eslint": "^10.0.1", | ||
"babel-plugin-istanbul": "^5.1.0", | ||
"chai": "^4.2.0", | ||
"codecov": "^3.1.0", | ||
"copy": "^0.3.2", | ||
"cross-env": "^5.2.0", | ||
"eslint": "^5.9.0", | ||
"eslint-config-prettier": "^3.3.0", | ||
"eslint-plugin-flowtype": "^3.2.0", | ||
"eslint-watch": "^4.0.2", | ||
"flow-bin": "^0.92.0", | ||
"flow-copy-source": "^2.0.2", | ||
"flow-watch": "^1.1.4", | ||
"husky": "^1.1.4", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^4.1.0", | ||
"nyc": "^11.4.1", | ||
"lint-staged": "^8.0.4", | ||
"mocha": "^6.2.1", | ||
"nyc": "^13.1.0", | ||
"prettier": "^1.15.2", | ||
"prettier-eslint": "^8.8.2", | ||
"rimraf": "^2.6.0", | ||
"semantic-release": "^15.1.4", | ||
"sinon": "^5.0.7", | ||
"travis-deploy-once": "^4.3.1" | ||
"sinon": "^9.0.3", | ||
"waait": "^1.0.5" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.1.5" | ||
} | ||
} |
# async-throttle | ||
[![Build Status](https://travis-ci.org/jcoreio/async-throttle.svg?branch=master)](https://travis-ci.org/jcoreio/async-throttle) | ||
-[![Coverage Status](https://codecov.io/gh/jcoreio/async-throttle/branch/master/graph/badge.svg)](https://codecov.io/gh/jcoreio/async-throttle) | ||
[![CircleCI](https://circleci.com/gh/jcoreio/async-throttle.svg?style=svg)](https://circleci.com/gh/jcoreio/async-throttle) | ||
[![Coverage Status](https://codecov.io/gh/jcoreio/es2015-library-skeleton/branch/master/graph/badge.svg)](https://codecov.io/gh/jcoreio/async-throttle) | ||
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) | ||
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) | ||
[![npm version](https://badge.fury.io/js/%40jcoreio%2Fasync-throttle.svg)](https://badge.fury.io/js/%40jcoreio%2Fasync-throttle) | ||
throttle async and promise-returning functions. Other packages don't do it right. | ||
throttle async and promise-returning functions. Other packages don't do it right. | ||
@@ -40,8 +41,9 @@ ## Installing | ||
By default, `func` is called with the most recent arguments to the throttled function. You can change this with the | ||
By default, `func` is called with the most recent arguments to the throttled function. You can change this with the | ||
`getNextArgs` option -- for example, if you want to invoke `func` with the minimum of all arguments since the last | ||
invocation: | ||
```js | ||
const throttled = throttle(foo, 10, { | ||
getNextArgs: ([a], [b]) => [Math.min(a, b)] | ||
getNextArgs: ([a], [b]) => [Math.min(a, b)], | ||
}) | ||
@@ -48,0 +50,0 @@ throttled(2) |
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
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
61
10556
1
35
5
56
+ Added@babel/runtime@^7.1.5
+ Added@babel/runtime@7.26.0(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)