my-nodegreet-module 1.0.4

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 +25 -0
  2. package/package.json +12 -0
  3. package/test.js +5 -0
package/index.js ADDED
@@ -0,0 +1,25 @@
1
+ //1st step:- npm init
2
+ //then ok -ok
3
+ //write greet() function
4
+ //then run cmd:-node test.js
5
+ /*Go to npm website.
6
+ Register an account.
7
+ cmd: npm login
8
+ then it will go to npm web and ask for otp
9
+ or:-very optional
10
+ username
11
+ password
12
+ email
13
+ cmd:npm publish
14
+ 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 :token
15
+
16
+
17
+
18
+ */
19
+ function greet(name){
20
+ return "Hello" + name;
21
+
22
+ }
23
+ module.exports=greet;
24
+
25
+ //module creation
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "my-nodegreet-module",
3
+ "version": "1.0.4",
4
+ "description": "",
5
+ "license": "ISC",
6
+ "author": "",
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,5 @@
1
+ //to test locally
2
+ const greet=require("./index")
3
+ console.log(greet("TYIT"))
4
+
5
+ //run using node test.js