Skip to content

RayID

A lightweight JavaScript library for generating short and readable identifiers.

RayID allows you to generate IDs with configurable character sets, making it useful for identifying logs, events, requests, and other application resources.

npm version

Package Information

Property Value
Package rayid
Registry npm
Latest Version npm
Runtime Node.js

Resources

Installation

npm install rayid@latest

Quick Start

import RayID from "rayid";

const ray = new RayID("lower");

const id = ray.gen(16);

console.log(id);

Character Types

RayID supports different character sets:

Type Characters
digit 0-9
lower a-z
upper A-Z
symbol Common symbols
Default All supported character sets

For example:

const digits = new RayID("digit");
const lowercase = new RayID("lower");
const uppercase = new RayID("upper");
const mixed = new RayID();

console.log(digits.gen(10));
console.log(lowercase.gen(10));
console.log(uppercase.gen(10));
console.log(mixed.gen(16));

For complete API references and examples, visit the official documentation.

License

See the source repository for licensing information.