@amth/druuid
v1.0.9
Published
Simple and secure file renaming utility using UUID
Readme
DRUUID
Simple and secure file renaming utility using UUID
Installation
npm install @amth/druuidUsage
import druuid from '@amth/druuid';
// or
import { druuid } from '@amth/druuid };
// Basic usage (default extension 'webp')
const newFileName = druuid('myFile'); // returns something like "1234abcd...webp"
// Custom length
const shortName = druuid('myFile', 8); // returns something like "1234abcd.webp"
// Specify different extension
const jpgFile = druuid('myFile', 36, 'jpg'); // returns something like "1234abcd...jpg"API
druuid(file: string, length?: number, ext?: "jpg" | "png" | "webp"): string
file: File name (required)length: Desired UUID length (1-36, default: 36)ext: File extension ("jpg" | "png" | "webp", default: "webp")
Supported Types
- jpg
- png
- webp
License
ISC
Author
AMTH.cloud — https://amth.cloud
