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

nuid

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuid - npm Package Compare versions

Comparing version 2.0.1-1 to 2.0.1-2

19

lib/nuid.js

@@ -32,4 +32,3 @@ /*

function fillRandom(a) {
var _a;
if ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.getRandomValues) {
if (globalThis?.crypto?.getRandomValues) {
globalThis.crypto.getRandomValues(a);

@@ -45,2 +44,18 @@ }

class Nuid {
/**
* @hidden
*/
buf;
/**
* @hidden
*/
seq;
/**
* @hidden
*/
inc;
/**
* @hidden
*/
inited;
constructor() {

@@ -47,0 +62,0 @@ this.buf = new Uint8Array(totalLen);

10

package.json
{
"name": "nuid",
"version": "2.0.1-1",
"version": "2.0.1-2",
"description": "NUID - A highly performant unique identifier generator.",

@@ -18,6 +18,3 @@ "keywords": [

"types": "./lib/nuid.d.ts",
"exports": {
"require": "./lib/nuid.js",
"import": "./esm/index.mjs"
},
"main": "./lib/nuid.js",
"homepage": "https://nats.io/nuid.js",

@@ -37,6 +34,5 @@ "repository": {

"contributors": [],
"main": "./index.js",
"scripts": {
"clean": "shx rm -f esm/index.mjs lib/nuid.d.ts lib/nuid.js lib/nuid.js.map",
"build": "npm run clean && deno bundle src/nuid.ts esm/index.mjs && tsc",
"build": "npm run clean && tsc",
"test": "npm run build && node --test test/basics.js && deno test",

@@ -43,0 +39,0 @@ "doc": "rm -Rf ./docs && node_modules/.bin/typedoc --out ./docs/ && touch ./docs/.nojekyll",

@@ -12,21 +12,24 @@ # Nuid.js

Import the library for node/bun:
For web and deno you can use the JSR bundle:
```bash
npm install nuid
npx jsr add @nats-io/nuid
// or
deno add @nats-io/nuid
```
For web and deno you can also:
```typescript
import { next, Nuid } from "jsr:@nats-io/nuid";
```
import { next
In node/bun:
```bash
npx jsr add @nats-io/nuid
npm install nuid
```
## Basic Usage
Reference the library in your code. If using you can `import` or `require` the
npm nuid library supports both Common JS and ESM:
```javascript
const { nuid, Nuid } = require("nuid");
const { next, Nuid } = require("nuid");
// or

@@ -40,2 +43,4 @@ import { next, Nuid } from "nuid";

## Basic Usage
```javascript

@@ -42,0 +47,0 @@ // To generate a bunch of nuids:

Sorry, the diff of this file is not supported yet

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