0.1.5 • Published 9 months ago

@aamirtech/utils v0.1.5

Weekly downloads
-
License
-
Repository
-
Last release
9 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.5

9 months ago

0.1.2

9 months ago

0.1.1

9 months ago

0.1.4

9 months ago

0.1.3

9 months ago

0.1.0

1 year ago

0.0.9

1 year ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago