This repository has been archived by the owner on Nov 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
README file updated And random string added
- Loading branch information
1 parent
161d5cc
commit c767e4a
Showing
5 changed files
with
82 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
|
@@ -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 | ||
|
@@ -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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |