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

eventid

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eventid - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

package.json
{
"name": "eventid",
"version": "0.1.1",
"version": "0.1.2",
"description": "A utility for generating monotonically increasing unique event ids across a network of services.",

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

# Monotonically increasing per machine, globally unique eventids
[![CircleCI][circle-image]][circle-url]
[![Dependencies][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
***Note: This is not an official Google product.***

@@ -9,2 +13,6 @@

This can be used instead of timestamps – JavaScript timestamps only have
millisecond resolution making them unsuitable for the purpose of building
monotonically increasing local ids.
```js

@@ -16,10 +24,14 @@ const EventId = require('eventid');

const id1 = eventId.new();
const id2 = eventId.new();
// Generate a globally unique identifier.
const id1 = eventId.new(); // -> "..........37qqNkj4K24ulWyeuWxpZh"
// Use the same generator to get monotonically increasing local ids.
const id2 = eventId.new(); // -> "..........77qqNkj4K24ulWyeuWxpZh"
// You can lexicographically compare the ids.
assert(id1 < id2); // -> true
// Another instance will use a different guid
const another = new EventId();
const id3 = another.new(); // -> "..........5rkLYOc5W8ZAHAmVSyrixJ"
```
[![CircleCI][circle-image]][circle-url]
[![Dependencies][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[circle-image]: https://circleci.com/gh/google/eventid-js.svg?style=svg

@@ -26,0 +38,0 @@ [circle-url]: https://circleci.com/gh/google/eventid-js

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