Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

block-sequence

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

block-sequence - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

package.json
{
"name": "block-sequence",
"version": "0.1.0",
"version": "0.1.1",
"description": "A sequential id generator, which grabs blocks of ids rather than just one at a time",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -7,8 +7,16 @@ # block-sequence

var BlockArray = require('block-sequence').BlockArray
var bsr = require('block-sequence-redis')
bsr({ host: 'redis.example.com' }, function(err, driver) {
var init = require('block-sequence-mysql')
// Initialise the MySql Block Sequence Driver. Other drivers are available
init({ host: '127.0.0.1', database: 'bs_test', user: 'root' }, function(err, driver) {
if (err) throw err
// Ensure the sequence exists
driver.ensure({ name: 'my-sequence' }, function(err, sequence) {
if (err) throw err
// Create a block array containing 1000 ids per block (defaults to 2 blocks)
var idGenerator = new BlockArray({ block: { driver: driver, size: 1000 } })
// Grab the next id
idGenerator.next(function(err, id) {

@@ -48,4 +56,7 @@ if (err) throw err

1. block-sequence-reference (in-memory reference implementation, only useful for testing)
2. block-sequence-redis (redis implementation)
1. [block-sequence-reference](https://www.npmjs.com/package/block-sequence-reference) (in-memory reference implementation, only useful for testing)
2. [block-sequence-redis](https://www.npmjs.com/package/block-sequence-redis)
3. [block-sequence-mysql](https://www.npmjs.com/package/block-sequence-mysql)
4. [block-sequence-postgres](https://www.npmjs.com/package/block-sequence-postgres)
5. [block-sequence-foxpro](https://www.youtube.com/watch?v=dQw4w9WgXcQ)

@@ -52,0 +63,0 @@ To add another driver please ensure it passes the block-sequence-compliance-tests

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