# string-code-from-number

> Generate a unique string from a number.

Latest version **1.0.3** (published 2020-09-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install string-code-from-number
pnpm add string-code-from-number
yarn add string-code-from-number
bun add string-code-from-number
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-09-05 |
| First published | 2020-09-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Milan Mooibroek |
| Maintainers | milan-mooibroek |
| Keywords | string generator, string generator from number, string code from number, unique string generator from number |

## Links

- npm: https://www.npmjs.com/package/string-code-from-number
- Repository: https://github.com/milan-mooibroek/npm-string-code-from-number
- Homepage: https://github.com/milan-mooibroek/npm-string-code-from-number#readme
- Issues: https://github.com/milan-mooibroek/npm-string-code-from-number/issues
- npm.io page: https://npm.io/package/string-code-from-number

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2020-09-05
- 1.0.2 — 2020-09-05
- 1.0.1 — 2020-09-01
- 1.0.0 — 2020-09-01

## README

# String code from number generator

The string-code-from-number package is a tool to generate unique short strings from numbers.

## Installation

Use the package manager [npm](https://www.npmjs.com/get-npm) to install string code from number generator.

```bash
npm install string-code-from-number -s
```

## Usage

```javascript
const stringCodeFromNumber = require('string-code-from-number');
const stringGenerator = new stringCodeFromNumber('abcd');
const unqiueString = stringGenerator.generate(1) // a
```

if `new stringCodeFromNumber()` is empty it will be filled with : abcdefghijklmnopqrstuvwxyz0123456789

## Examples

```javascript
const stringCodeFromNumber = require('string-code-from-number');
const stringGenerator = new stringCodeFromNumber('abcd');

console.log(stringGenerator.generate(1)); //  a
console.log(stringGenerator.generate(4)); //  d
console.log(stringGenerator.generate(5)); //  aa
console.log(stringGenerator.generate(6)); //  ab
console.log(stringGenerator.generate(20)); //  dd
console.log(stringGenerator.generate(21)); //  aaa
console.log(stringGenerator.generate(83)); //  ddd
console.log(stringGenerator.generate(84)); //  aaaa
```


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

---
_Source: https://npm.io/package/string-code-from-number · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
