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

https://github.com/aswathkk/js-randstr

Javascript Random string generator
https://github.com/aswathkk/js-randstr

javascript-library js-randstr random-string

Last synced: about 1 month ago
JSON representation

Javascript Random string generator

Awesome Lists containing this project

README

          

# js-randstr
Simple library to generate random strings

## Installation
using [npm](http://github.com/isaacs/npm)
```sh
npm install js-randstr
```
using [bower](http://bower.io)
```sh
bower install js-randstr
```

## Usage
For nodejs
```js
var randstr = require('js-randstr');

// Generate random string of length 6
randstr(6);

// Generate random string with specified charset
randstr(8, 'abcd');

```

For browser
```html

// Generate random string of length 6
randstr(6);

// Generate random string with specified charset
randstr(8, 'abcd');

```

## Tests
```sh
# install dev dependencies
npm install

# run tests
npm test
```