New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

pooler

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pooler

A generic pooling interface and TypeScript/JavaScript implementation.

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
27
237.5%
Maintainers
1
Weekly downloads
 
Created
Source

Pooler

npm npm downloads GitHub issues Travis Coverage Status GitHub license

A generic pooling interface and TypeScript/JavaScript implementation.

The interface

The heart of pooler is the interface. The interface is largely taken from the Go standard library where the two key methods are get and put.

Unique to this library is the method use. The use method is a convenience feature that abstracts the logic of both get and put by passing in a callback to be executed with a value from the pool. This is especially nice for making single queries to a database. It removes the need for a lot of boilerplate code, and also removes the possibility you forget to put the value back in the pool.

Note that the factory function implements an equal jitter exponential backoff for retrying resource creation.

pooler interface

Basic Usage

To get started, created a pooler from the implementation's option object.

basic usage with database

FAQs

Package last updated on 12 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts