yuma_rand 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +7 -0
  2. package/package.json +12 -0
  3. package/test.js +2 -0
package/index.js ADDED
@@ -0,0 +1,7 @@
1
+
2
+ // rand 获得一个
3
+ function rand(m,n){
4
+ return Math.floor(Math.random()* (n-m+1)) + m;
5
+ }
6
+
7
+ module.exports = rand;
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "yuma_rand",
3
+ "version": "1.0.0",
4
+ "description": "用来生成一个随机数",
5
+ "license": "ISC",
6
+ "author": "qiangge",
7
+ "type": "commonjs",
8
+ "main": "index.js",
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1"
11
+ }
12
+ }
package/test.js ADDED
@@ -0,0 +1,2 @@
1
+ const rand = require('./index');
2
+ console.log(rand(1,100));