0.1.0 • Published 3 months ago

@aamirtech/utils v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

aamirtech

@aamirtech/utils

GitHub license Maintainer Downloads Npm package version

Library packed with your basic code utils.

Installation

Install with npm

  npm install @aamirtech/utils

Install with yarn

  yarn add @aamirtech/utils

Install with bun

  bun add @aamirtech/utils

Usage

Simple Snowflake Generation

import { Id } from "@aamirtech/utils";

console.log(Snowflake.generate());
// 7167216930510602240

Publid ID / OTP Generation

OptionTypeDefaultDescription
lengthnumber6Length of the public id
alphabeticbooleantrueInclude alphabets in the public id
numericbooleantrueInclude numbers in the public id
import { getPublicId } from "@aamirtech/utils";

// Mix of Alphabets and Numbers (default)
console.log(getPublicId(6));
// 7C43DU

// Alphabets only
console.log(getPublicId(6, { alphabetic: true }));
// FZPUWJ

// Numbers only
console.log(getPublicId(6, { numeric: true }));
// 252537

Tests

Tests are written in Bun Test. To run tests, run the following command:

  bun test

To run tests with coverage, run the following command:

  bun test:coverage
```

## License

[MIT](https://choosealicense.com/licenses/mit/)

The project contains part based on a fork off of (snowflake-generator)[https://github.com/FatAussieFatBoy/snowflake-generator].
0.1.0

3 months ago

0.0.9

4 months ago

0.0.8

5 months ago

0.0.7

5 months ago

0.0.6

5 months ago

0.0.5

5 months ago

0.0.4

5 months ago

0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago