safe-shortid
Version:
A library for generating safe short IDs with inappropriate word filtering
40 lines (28 loc) • 675 B
Markdown
A library for generating safe short IDs that automatically filters out potentially inappropriate words.
```bash
npm install safe-shortid
yarn add safe-shortid
pnpm add safe-shortid
```
```javascript
// ESM
import { generate } from 'safe-shortid';
// CommonJS
const { generate } = require('safe-shortid');
// Generate an ID
const id = generate();
console.log(id); // Example: "abc123"
```
- 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
MIT