New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sealsystems/counter-storage

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sealsystems/counter-storage

@sealsystems/counter-storage manages handling of counters persisted in a MongoDB

  • 0.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
3
Weekly downloads
 
Created
Source

@sealsystems/counter-storage

CircleCI AppVeyor

@sealsystems/counter-storage manages handling of counters persisted in a MongoDB.

Installation

$ npm install @sealsystems/counter-storage

Quick start

First you need to add a reference to @sealsystems/counter-storage within your application:

const counterStorage = require('@sealsystems/counter-storage');

Then you can connect to a MongoDB. For that call the connect function and provide the database's connection string using the url property:

const storage = await counterStorage.connect({
  url: 'mongodb://localhost:27017'
});

Optionally, you may also specify the number of connection retries:

const storage = await counterStorage.connect({
  url: 'mongodb://localhost:27017',
  connectionRetries: 10
});

Get next counter value

To get the next counter value call the getCounter function and provide its name. Optionally you can provide the increment as second argument, default increment is 1:

const newCounterValue = await storage.getCounter('hugo');

With increment:

const newCounterValue = await storage.getCounter('hugo', 100);

Running the build

To build this module use roboter.

$ bot

FAQs

Package last updated on 02 Mar 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

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