Skip to content
This repository has been archived by the owner on Nov 2, 2019. It is now read-only.

Commit

Permalink
README file updated And random string added
Browse files Browse the repository at this point in the history
  • Loading branch information
Prosen-Ghosh committed Aug 26, 2017
1 parent 161d5cc commit c767e4a
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 7 deletions.
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# random-pro
A JavaScript package for random things.

# Installation
## Installation
```npm install random-pro```

# Number
## Number

```javascript
var rand = require('random-pro');
Expand All @@ -29,7 +29,7 @@ console.log(rand.generateNumber(0));
console.log(rand.generateNumber(300));
// 94
```
# Users
## Users

***generateName()*** This function Will generate random name.
```javascript
Expand Down Expand Up @@ -81,6 +81,25 @@ console.log(rand.generateEmail());
console.log(rand.generateEmail());
// [email protected]
```
# License

## String

***generateString(words,paragraph)*** This function will generate random string. The default parameter of this function of word and paragraph is 1.

```javascript
var rand = require('random-pro');
console.log(rand.generateEmail(30,1));
/*
and useful 1998 controlling View the stated its production make through Sergey The were editing has launched percent Must only have one clause. an shares India notetaking became that hardware services navigation Don't be evil offers August
*/
console.log(rand.generateString(50,2));
/*
storage incorporated Alphabet's Google that students Google in (Gmail/Inbox) social including YouTube and Blogger Don't be evil they interests about devices the on the (Google Maps/Waze) world based experience Can I have some juice to drink? an and Must express a complete thought. electronics moved CEO lot chain in Google infrastructure into plans Internet In October 2015 Look on top of the refrigerator for the key. Android Google conglomerate a mission These Project Google and February
voting also Project the with Station the its initiative public incorporated was be the chat Google mobile storage of Google and its unofficial slogan was Google Google sharing Ph.D. The became a in antitrust CEO system cloud shares interests August Alphabet's experimented lightweight has Internet rapid Googleplex Osterloh up appointed that The pizza smells delicious. Googleplex (Gmail/Inbox)
*/
```

## License

MIT
39 changes: 39 additions & 0 deletions data/text.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
var numberPro = require('./src/pro-number.js');
var usersPro = require('./src/pro-users');
console.log(usersPro.randGenerateEmail())
var stringPro = require('./src/pro-string');
module.exports = {
generateNumber : numberPro.randNumber,
generateName : usersPro.randGenerateUserName,
generateLastName : usersPro.randGenerateLastName,
generateFullName : usersPro.randGenerateFullName,
generateEmail : usersPro.randGenerateEmail
generateEmail : usersPro.randGenerateEmail,
generateString : stringPro.generateString
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "random-pro",
"version": "0.0.5",
"version": "0.0.6",
"description": "A JavaScript package for random things.",
"main": "index.js",
"scripts": {
Expand Down
16 changes: 16 additions & 0 deletions src/pro-string.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var text = require('./../data/text');

var generateString = function(words = 1,paragraph = 1){

let tmp = '';
for(let i = 0; i < paragraph; i++){
for(let j = 0; j < words; j++){
tmp += text[Math.floor(Math.random() * text.length + 1)] + " ";
}
tmp += "\n\n";
}
return tmp;
}
module.exports = {
generateString
}

0 comments on commit c767e4a

Please sign in to comment.