# zid

> Generate random strings made up of [A-Za-z0-9] that are also URL compatible.

Latest version **0.4.0** (published 2020-11-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install zid
pnpm add zid
yarn add zid
bun add zid
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2020-11-29 |
| First published | 2015-08-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Andrew Chilton |
| Maintainers | chilts |
| Keywords | random, string, token, url |

## Links

- npm: https://www.npmjs.com/package/zid
- Repository: https://github.com/chilts/zid
- Issues: https://github.com/chilts/zid/issues
- npm.io page: https://npm.io/package/zid

## Dependencies (1)

- [math-random](https://npm.io/package/math-random.md) ^1.0.1

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.4.0 (latest) — 2020-11-29
- 0.3.0 — 2018-08-09
- 0.2.0 — 2015-08-08
- 0.1.0 — 2015-08-08

## README

# zid #

[![Build Status](https://secure.travis-ci.org/chilts/zid.png?branch=master)](http://travis-ci.org/chilts/zid)

[![NPM](https://nodei.co/npm/zid.png?downloads=true)](https://nodei.co/npm/zid/)

Generate random strings made up of [A-Za-z0-9] that are also URL compatible. Only good package name of '?id' left.

You choose the length. No underscore, no dash, no slash or backslash, indeed no other chars.

## Synopsis ##

```js
var zid = require('zid')

console.log(zid(6))
// -> 'fA8ljv'

console.log(zid(12))
// -> 'vy9gDZwKJmdK'

console.log(zid(0))
// -> throws

console.log(zid(-1))
// -> throws

console.log(zid())
// -> throws

console.log(zid('hello'))
// -> throws

```

### Options ###

#### `lookalikes` ####

You can also exclude lookalike chars such as `OISZbl` by using
`{ lookalikes: false }`:

```
console.log(zid({ lookalikes: false }))
// -> returns an ID using these chars only:
// -> ABCDEFGHJKLMNPQRTUVWXYacdefghijkmnopqrstuvwxyz0123456789
// -> i.e. no OISZbl
```

## AUTHOR ##

Written by [Andrew Chilton](https://chilts.org/):

* [Blog](https://chilts.org/)
* [Twitter](https://twitter.com/andychilton)
* [GitLab](https://gitlab.com/chilts)
* [GitHub](https://github.com/chilts) (deprecated)

# License #

MIT

(Ends)

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