Socket
Socket
Sign inDemoInstall

tarn

Package Overview
Dependencies
Maintainers
4
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tarn - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

dist/PendingOperation.d.ts

28

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc