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
- Host: GitHub
- URL: https://github.com/aswathkk/js-randstr
- Owner: aswathkk
- License: mit
- Created: 2017-03-10T16:53:30.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-13T06:45:16.000Z (almost 9 years ago)
- Last Synced: 2026-01-23T17:56:29.169Z (2 months ago)
- Topics: javascript-library, js-randstr, random-string
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```