Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/iguntur/randid

Generate random string or ID
https://github.com/iguntur/randid

Last synced: about 11 hours ago
JSON representation

Generate random string or ID

Awesome Lists containing this project

README

        

# randid

[![Build Status](https://travis-ci.com/iguntur/randid.svg?token=Gqg6SWkLJ3YyFSAu5i3M&branch=master)](https://travis-ci.com/iguntur/randid)
[![npm](https://img.shields.io/npm/v/@guntur/randid.svg?style=flat)](https://www.npmjs.org/package/@guntur/randid)
[![node](https://img.shields.io/node/v/@guntur/randid.svg?style=flat)](https://nodejs.org)

> Generate a random string or id

---

## Install

```console
$ npm install @guntur/randid
```

## Usage

```js
const randid = require('@guntur/randid');

randid().then(str => {
console.log(str);
//=> l43xxapV9aWq
});

console.log(randid.sync({length: 24}));
//=> x3qAJC3d7ra4IafxmtXEqWkK
```

## API

### randid(`options`)

- Params:
- `options`: [``](#options)
- Returns: `Promise`

### randid.sync(`options`)

- Params:
- `options`: [``](#options)
- Returns: ``

#### `Options`

- `length`: ``
- default: `12`

## License

MIT © [Guntur Poetra](https://github.com/iguntur)