@koober/uuid
v1.0.0-rc.54
Published
UUID generator
Downloads
3
Readme
UUID Generator library (@koober/uuid)
UUID generator
Installation
npm install @koober/uuid
Usage
import { randomUUID } from '@koober/uuid';
import { runTask, Task } from '@koober/std';
function createUser(name: string) {
return Task.map(randomUUID, (uuid) => ({
id: uuid,
name,
}));
}
export function main(): void {
const userTask = createUser('John Doe');
console.log(runTask(userTask)); // > Result.Ok({ id: 'XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX', name: 'John Doe' })
}
License
MIT © Julien Polo [email protected]