UNPKG

safe-shortid

Version:

A library for generating safe short IDs with inappropriate word filtering

40 lines (28 loc) 675 B
# safe-shortid A library for generating safe short IDs that automatically filters out potentially inappropriate words. ## Installation ```bash npm install safe-shortid # or yarn add safe-shortid # or pnpm add safe-shortid ``` ## Usage ```javascript // ESM import { generate } from 'safe-shortid'; // CommonJS const { generate } = require('safe-shortid'); // Generate an ID const id = generate(); console.log(id); // Example: "abc123" ``` ## Features - Generates short, unique IDs - Automatically filters out inappropriate words - Works in both Node.js and browsers - Written in TypeScript with full type definitions - Supports both ESM and CommonJS ## License MIT