Comparing version 0.1.1 to 0.1.2
{ | ||
"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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17424
40