Skip to content

Commit f0ef046

Browse files
committed
make a small sample for getting obj and argv
1 parent 3b02b9a commit f0ef046

File tree

3 files changed

+55
-1
lines changed

3 files changed

+55
-1
lines changed

package-lock.json

+34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@
88
},
99
"keywords": [],
1010
"author": "",
11-
"license": "ISC"
11+
"license": "ISC",
12+
"dependencies": {
13+
"dotenv": "^16.1.3"
14+
}
1215
}

ruppin/script.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const name= process.argv[2];
2+
const age= process.argv[3];
3+
4+
console.log(process.env)
5+
const obj = {
6+
name:name ,
7+
age: age,
8+
printAge: function(){
9+
console.log(this.age);
10+
},
11+
printName() {
12+
console.log(this.name);
13+
}
14+
}
15+
16+
obj.printAge();
17+
obj.printName();

0 commit comments

Comments
 (0)