Git Product home page Git Product logo

eventid-js's Introduction

eventid

Monotonically increasing per machine, globally unique eventids

npm version Build Status Dependencies Known Vulnerabilities

Note: This is not an official Google product.

An eventId uniquely identifies an event across a network of services. It is globally unique, and is monotically increasing locally. This makes eventids useful for lexically comparable identifiers for events in a distributed system.

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.

Installation

$ npm install eventid

Usage

const EventId = require('eventid');

// Instantiate a generator.
const eventId = new EventId();

// 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"

License

Apache 2.0

eventid-js's People

Contributors

bcoe avatar crcornwell avatar dependabot[bot] avatar greenkeeper[bot] avatar jinwoo avatar justinbeckwith avatar ofrobots avatar release-please[bot] avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

eventid-js's Issues

`d64` dependency causes DeprecationWarnings

A dependency of this library, d64, is causing DeprecationWarnings to be logged whenever eventid is used. d64 was last published 8 years ago and appears to be dead or, to use a less negative phrase, “feature complete”. It’s a pretty small library and could probably be inlined, but I don’t know whether or not you all would dig that idea.

Related upstream issue: dominictarr/d64#4

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency gts to v5

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yaml
  • actions/checkout v2
  • actions/setup-node v2
  • codecov/codecov-action v1
  • actions/checkout v2
  • actions/setup-node v2
  • actions/checkout v2
  • actions/setup-node v2
  • actions/checkout v2
  • actions/setup-node v2
.github/workflows/release.yml
  • actions/checkout v2
  • actions/setup-node v2
npm
package.json
  • uuid ^8.0.0
  • @types/mocha ^9.0.0
  • @types/node ^16.0.0
  • @types/uuid ^8.0.0
  • c8 ^7.3.0
  • gts ^3.0.0
  • js-green-licenses ^3.0.0
  • mocha ^9.0.0
  • typescript ^4.0.0
  • node >=10

  • Check this box to trigger a request for Renovate to run again on this repository

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Releases still broken :(

Getting this error I don't know what to do with from the action:

Run GoogleCloudPlatform/release-please-action@v2
✖ no recent release PRs found
✔ found 55 commits since 20a013ef2c175db7c62bffda4d83117d49a7f901
✔ release as major: There is 1 BREAKING CHANGE and 0 features
✔ updating package-lock.json from 1.0.0 to 2.0.0
✖ file samples/package.json did not exist
✔ updating CHANGELOG.md
✔ updating package.json from 1.0.0 to 2.0.0
{"level":50,"time":1610167165189,"pid":2690,"hostname":"fv-az52-90","msg":"Error while creating a tree and updating the ref"}
Error: release-please failed: Not Found

configure for automated releases

This will not be automatically published when we create a release; one option would be using the release-please-action, with an npm publish step.

uuid module is still 3.4.0 at release version

Hi I have seen that you have upgraded uuid to version 8 and upper at main branch, but latest release 1.0.0 still uses 3.4.0.

Also @google-cloud/logging still uses eventid version 1.0.0 , so it didn't get this upgrade.

warning @google-cloud/logging > eventid > [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.