open-index/open-npm huggingface dataset:
npm package: @panac/generateuuid
Author: panac
Latest version: 1.0.1


# generateuuid


``` js
const { generateUUID } = require('@panac/generateuuid');

console.log(generateUUID());
```

`31mz5p1fcsk-mqs3u8vqewq-0yjura1te32c-xwio5l4rz49-bp408vu4qv-k0u7wj2avo`


``` ts
import { generateUUID } from '@panac/generateuuid';

console.log(generateUUID());
```

`31mz5p1fcsk-mqs3u8vqewq-0yjura1te32c-xwio5l4rz49-bp408vu4qv-k0u7wj2avo`
npm package: @panac/pipe-compose
Description: ### pipe
Author: panac
Latest version: 1.0.0


# pipe and compose function

### pipe

``` ts

function sleep() {
    return new Promise((resolve, reject) => {
      setTimeout(() => resolve(), 1000);
    });
  }

  const testtest = async () => {
    const fn1 = async (val: string) => {
      await sleep();
      return `fn1(${val})`;
    };
    const fn2 = async (val: string) => {
      await sleep();
      return `fn2(${val})`;
    };
    const fn3 = async (val: string) => {
      await sleep();
      return `fn3(${val})`;
    };
    return pipe(
      fn1,
      fn2,
      fn3
    )('inner');
  };

  await testtest() // 'fn3(fn2(fn1(inner)))'
```

### compose

``` ts
function sleep() {
    return new Promise((resolve, reject) => {
      setTimeout(() => resolve(), 1000);
    });
  }

  const testtest = async () => {
    const fn1 = async (val: string) => {
      await sleep();
      return `fn1(${val})`;
    };
    const fn2 = async (val: string) => {
      await sleep();
      return `fn2(${val})`;
    };
    const fn3 = async (val: string) => {
      await sleep();
      return `fn3(${val})`;
    };
    return (await compose(
      fn1,
      fn2,
      fn3
    ))('inner');
  };

  await testtest() // 'fn1(fn2(fn3(inner)))'
```