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 ~ create lib/util functions ~ more test included
- Loading branch information
1 parent
b81a407
commit 0733c35
Showing
6 changed files
with
51 additions
and
37 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,34 +1,24 @@ | ||
# random-pro | ||
A JavaScript package for random things. | ||
|
||
    | ||
   | ||
|
||
A JavaScript package for random things. | ||
|
||
 | ||
|
||
 | ||
 | ||
 | ||
|
||
 | ||
|
||
 | ||
 | ||
|
||
## Features | ||
|
||
# Features | ||
|
||
## Install | ||
|
||
`npm install --save random-pro` | ||
|
||
|
||
## Scripts | ||
|
||
- **npm run test** : `mocha || true` | ||
- **npm run readme** : `node ./node_modules/.bin/node-readme` | ||
|
||
## Dependencies | ||
## Development Dependencies | ||
|
||
Package | Version | Dev | ||
--- |:---:|:---: | ||
|
@@ -37,30 +27,16 @@ Package | Version | Dev | |
[node-readme](https://www.npmjs.com/package/node-readme) | ^0.1.9 | ✔ | ||
|
||
|
||
## Contributing | ||
|
||
Contributions welcome; Please submit all pull requests the against master branch. If your pull request contains JavaScript patches or features, you should include relevant unit tests. Please check the [Contributing Guidelines](contributng.md) for more details. Thanks! | ||
|
||
## Author | ||
|
||
Prosen Ghosh <[email protected]> (https://bd.linkedin.com/in/prosen-ghosh-baba9aa8) | ||
|
||
## License | ||
|
||
- **MIT** : http://opensource.org/licenses/MIT | ||
# random-pro | ||
A JavaScript package for random things. | ||
|
||
## Installation | ||
```npm install random-pro``` | ||
|
||
## Number | ||
|
||
***generateNumber()*** This Function will generate random number. | ||
|
||
```javascript | ||
var rand = require('random-pro'); | ||
console.log(rand.generateNumber()); | ||
// 0.24763671110551866 | ||
``` | ||
|
||
***generateNumber(start)*** This function will generate random number from your input number to 1000 inclusive. | ||
|
||
```javascript | ||
|
@@ -70,6 +46,7 @@ console.log(rand.generateNumber(75)); | |
console.log(rand.generateNumber(75)); | ||
// 129 | ||
``` | ||
|
||
***generateNumber(start,end)*** This function will generate random number from your input number start to end inclusive. | ||
|
||
```javascript | ||
|
@@ -82,22 +59,26 @@ console.log(rand.generateNumber(300)); | |
## Users | ||
|
||
***generateName()*** This function Will generate random name. | ||
|
||
```javascript | ||
var rand = require('random-pro'); | ||
console.log(rand.generateName()); | ||
// Johirul | ||
console.log(rand.generateName()); | ||
// Abhijit | ||
``` | ||
|
||
You can also use gender for generate name. | ||
***generateName(gender)*** This Function will generate name based on gender. Gender Is case insensitive. | ||
|
||
```javascript | ||
var rand = require('random-pro'); | ||
console.log(rand.generateName("male")); | ||
// Sany | ||
console.log(rand.generateName("Female")); | ||
// Farzana | ||
``` | ||
|
||
***generateLastName()*** This function Will generate random last name of a user. | ||
|
||
```javascript | ||
|
@@ -107,6 +88,7 @@ console.log(rand.generateLastName()); | |
console.log(rand.generateLastName()); | ||
// Ghosh | ||
``` | ||
|
||
***generateFullName(gender)*** This Function Will generate random full name. The Deafult parameter of the function is `Male`. | ||
|
||
```javascript | ||
|
@@ -134,7 +116,7 @@ console.log(rand.generateEmail()); | |
|
||
## String | ||
|
||
***generateString(words,paragraph)*** This function will generate random string. The default parameter of this function of word and paragraph is 1. | ||
***generateString(latters,paragraph)*** This function will generate random string. The default parameter of this function of latters is 50 and paragraph is 1. | ||
|
||
```javascript | ||
var rand = require('random-pro'); | ||
|
@@ -152,4 +134,8 @@ console.log(rand.generateString(50,2)); | |
|
||
## License | ||
|
||
MIT | ||
- **MIT** : http://opensource.org/licenses/MIT | ||
|
||
## Author | ||
|
||
***Prosen Ghosh*** <[email protected]> (https://bd.linkedin.com/in/prosen-ghosh-baba9aa8) |
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,11 @@ | ||
var countWord = (str) => { | ||
return str.length; | ||
} | ||
|
||
var checkEmail = (email) => { | ||
return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email); | ||
} | ||
module.exports = { | ||
countWord, | ||
checkEmail | ||
} |
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
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