Skip to content

Commit

Permalink
Add examples and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tshemsedinov committed Dec 8, 2023
1 parent ba1771c commit ae61d34
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ const result = await ac;
- `md5(fileName: string): Promise<string>`
- `getX509(cert: X509Certificate): Strings`

```js
const x509 = new crypto.X509Certificate(cert);
const domains = metautil.getX509names(x509);
```

## Datetime utilities

- `duration(s: string | number): number`
Expand Down Expand Up @@ -265,6 +270,24 @@ semaphore.leave();
- `bytesToSize(bytes: number): string`
- `sizeToBytes(size: string): number`

```js
const size = bytesToSize(100000000);
const bytes = sizeToBytes(size);
console.log({ size, bytes });
// { size: '100 MB', bytes: 100000000 }
```

| Symbol | zeros | Unit |
|-------:|------:|-----------|
| yb | 24 | yottabyte |
| zb | 21 | zettabyte |
| eb | 18 | exabyte |
| pb | 15 | petabyte |
| tb | 12 | terabyte |
| gb | 9 | gigabyte |
| mb | 6 | megabyte |
| kb | 3 | kilobyte |

## License & Contributors

Copyright (c) 2017-2023 [Metarhia contributors](https://github.com/metarhia/metautil/graphs/contributors).
Expand Down

0 comments on commit ae61d34

Please sign in to comment.