@koober/uuid
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-rc.54 • Public • Published

UUID Generator library (@koober/uuid)

NPM Version License

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 julien.polo@koober.com

/@koober/uuid/

    Package Sidebar

    Install

    npm i @koober/uuid

    Weekly Downloads

    0

    Version

    1.0.0-rc.54

    License

    MIT

    Unpacked Size

    11.2 kB

    Total Files

    15

    Last publish

    Collaborators

    • jpolo
    • alexandrech
    • avatar-koober
    • alexwf.koober
    • jarvis_koober