@armandwipangestu/my-first-npm-package 1.3.0-rc.2 → 1.3.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.
- package/bin/index.js +3 -0
- package/package.json +3 -3
- package/bin/index.cjs +0 -17
package/bin/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@armandwipangestu/my-first-npm-package",
|
|
3
|
-
"version": "1.3.0
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Simple CLI example published with semantic-release",
|
|
5
5
|
"bin": {
|
|
6
|
-
"my-first-npm-package": "bin/index.
|
|
6
|
+
"my-first-npm-package": "bin/index.js"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"bin"
|
|
10
10
|
],
|
|
11
|
-
"main": "index.
|
|
11
|
+
"main": "index.js",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
14
14
|
"lint": "echo \"Error: no lint specified\" && exit 1"
|
package/bin/index.cjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require("fs")
|
|
4
|
-
const path = require("path")
|
|
5
|
-
|
|
6
|
-
const pkgPath = path.join(__dirname, "../package.json")
|
|
7
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"))
|
|
8
|
-
|
|
9
|
-
const args = process.argv.slice(2)
|
|
10
|
-
|
|
11
|
-
if (args.includes("--version") || args.includes("-v")) {
|
|
12
|
-
console.log(`v${pkg.version}`)
|
|
13
|
-
process.exit(0)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
console.log(`${pkg.name} is running...`)
|
|
17
|
-
console.log(`Current Version: ${pkg.version}`)
|