Comparing version 2.0.0 to 3.0.0
{ | ||
"name": "tarn", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Simple and robust resource pool for node.js", | ||
"main": "lib/tarn.js", | ||
"types": "lib/tarn.d.ts", | ||
"main": "dist/tarn.js", | ||
"types": "dist/tarn.d.ts", | ||
"license": "MIT", | ||
@@ -12,4 +12,5 @@ "scripts": { | ||
"build": "tsc", | ||
"clean": "rm -rf lib", | ||
"clean": "rm -rf dist", | ||
"prepublishOnly": "tsc", | ||
"lint": "eslint --format codeframe \"src/**/*.ts\"", | ||
"format": "prettier **/*.{js,ts} --write" | ||
@@ -37,3 +38,3 @@ }, | ||
"LICENSE", | ||
"lib/*" | ||
"dist/*" | ||
], | ||
@@ -52,12 +53,17 @@ "husky": { | ||
"devDependencies": { | ||
"@types/node": "^10.5.2", | ||
"bluebird": "^3.5.3", | ||
"@types/node": "^10.17.17", | ||
"@typescript-eslint/eslint-plugin": "^2.21.0", | ||
"@typescript-eslint/parser": "^2.21.0", | ||
"bluebird": "^3.7.2", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.10.0", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
"expect.js": "^0.3.1", | ||
"husky": "^1.3.1", | ||
"lint-staged": "^8.0.4", | ||
"mocha": "^5.2.0", | ||
"prettier": "^1.13.7", | ||
"typescript": "3.2.4" | ||
"lint-staged": "^9.5.0", | ||
"mocha": "^7.1.0", | ||
"prettier": "^1.19.1", | ||
"typescript": "3.8.3" | ||
}, | ||
"dependencies": {} | ||
} |
@@ -23,5 +23,5 @@ [![Build Status](https://travis-ci.org/Vincit/tarn.js.svg?branch=master)](https://travis-ci.org/Vincit/tarn.js) | ||
const pool = new Pool({ | ||
// function that creates a resource. You can either pass the resource | ||
// Function that creates a resource. You can either pass the resource | ||
// to the callback(error, resource) or return a promise that resolves the resource | ||
// (but not both). | ||
// (but not both) Callback syntax will be deprecated at some point. | ||
create: cb => { | ||
@@ -31,5 +31,6 @@ cb(null, new SomeResource()); | ||
// validates a connection before it is used. Return true or false | ||
// Validates a connection before it is used. Return true or false | ||
// from it. If false is returned, the resource is destroyed and a | ||
// another one is acquired. | ||
// another one is acquired. Should return a Promise if validate is | ||
// async function. | ||
validate: resource => { | ||
@@ -39,5 +40,4 @@ return true; | ||
// function that destroys a resource, should return promise if | ||
// destroying is asynchronous operation | ||
// (destroy does not support callback syntax like create) | ||
// Function that destroys a resource, should return promise if | ||
// destroying is asynchronous operation. | ||
destroy: someResource => { | ||
@@ -74,3 +74,3 @@ someResource.cleanup(); | ||
// long long to idle after failed create before trying again | ||
// how long to idle after failed create before trying again | ||
createRetryIntervalMillis: 200, | ||
@@ -166,2 +166,9 @@ | ||
### 3.0.0 2020-04-18 | ||
- Async validation support, now validation resource function can return a promise #45 | ||
- Fixed releasing abandoned resource after creation when create timeout #48 | ||
Released as major version, because async validation support did require lots of internal changes, which may cause sutil difference in behavior. | ||
### 2.0.0 2019-06-02 | ||
@@ -168,0 +175,0 @@ |
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
39778
817
186
13
1