node-power-user 0.0.10 → 0.0.11
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/dist/cli.js +24 -1
- package/package.json +8 -5
- package/src/cli.js +24 -1
- package/src/prepare.js +0 -7
package/dist/cli.js
CHANGED
|
@@ -17,7 +17,8 @@ const JSON5 = require('json5');
|
|
|
17
17
|
function Main() {}
|
|
18
18
|
|
|
19
19
|
Main.prototype.process = async function (args) {
|
|
20
|
-
|
|
20
|
+
const self = this;
|
|
21
|
+
args = args || process.argv
|
|
21
22
|
self.options = {};
|
|
22
23
|
self.argv = argv;
|
|
23
24
|
self.npu_packageJSON = require('../package.json');
|
|
@@ -43,6 +44,28 @@ Main.prototype.process = async function (args) {
|
|
|
43
44
|
return console.log(chalk.blue(`The current project (${chalk.bold(self.proj_packageJSON.name)}) is v${chalk.bold(self.proj_packageJSON.version)}`));
|
|
44
45
|
}
|
|
45
46
|
|
|
47
|
+
if (self.options.lp || self.options.listpackages || self.options['-lp'] || self.options['-listpackages']) {
|
|
48
|
+
console.log(chalk.blue.bold(`Dependencies:`));
|
|
49
|
+
Object.keys(self.proj_packageJSON.dependencies || {})
|
|
50
|
+
.forEach((dep, i) => {
|
|
51
|
+
console.log(chalk.blue(`${dep} @ ${self.proj_packageJSON.dependencies[dep]}`));
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
console.log(chalk.blue.bold(`\nDev Dependencies:`));
|
|
55
|
+
Object.keys(self.proj_packageJSON.devDependencies || {})
|
|
56
|
+
.forEach((dep, i) => {
|
|
57
|
+
console.log(chalk.blue(`${dep} @ ${self.proj_packageJSON.devDependencies[dep]}`));
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
console.log(chalk.blue.bold(`\Peer Dependencies:`));
|
|
61
|
+
Object.keys(self.proj_packageJSON.peerDependencies || {})
|
|
62
|
+
.forEach((dep, i) => {
|
|
63
|
+
console.log(chalk.blue(`${dep} @ ${self.proj_packageJSON.peerDependencies[dep]}`));
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
46
69
|
if (self.options.clean) {
|
|
47
70
|
const NPM_INSTALL_FLAG = self.options['--no-optional'] || self.options['-no-optional'] || self.options['no-optional'] ? '--no-optional' : ''
|
|
48
71
|
const NPM_CLEAN = `rm -fr node_modules && rm -fr package-lock.json && npm cache clean --force && npm install ${NPM_INSTALL_FLAG} && npm rb`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-power-user",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "Easy tools for every Node.js developer!",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
13
|
-
"start": "node
|
|
14
|
-
"prepare": "node
|
|
13
|
+
"start": "node -e 'new (require(`./src/cli.js`))().process()'",
|
|
14
|
+
"prepare": "node -e 'require(`prepare-package`)'"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
@@ -41,5 +41,8 @@
|
|
|
41
41
|
"files": [
|
|
42
42
|
"bin/",
|
|
43
43
|
"src/"
|
|
44
|
-
]
|
|
45
|
-
|
|
44
|
+
],
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"prepare-package": "^0.0.6"
|
|
47
|
+
}
|
|
48
|
+
}
|
package/src/cli.js
CHANGED
|
@@ -17,7 +17,8 @@ const JSON5 = require('json5');
|
|
|
17
17
|
function Main() {}
|
|
18
18
|
|
|
19
19
|
Main.prototype.process = async function (args) {
|
|
20
|
-
|
|
20
|
+
const self = this;
|
|
21
|
+
args = args || process.argv
|
|
21
22
|
self.options = {};
|
|
22
23
|
self.argv = argv;
|
|
23
24
|
self.npu_packageJSON = require('../package.json');
|
|
@@ -43,6 +44,28 @@ Main.prototype.process = async function (args) {
|
|
|
43
44
|
return console.log(chalk.blue(`The current project (${chalk.bold(self.proj_packageJSON.name)}) is v${chalk.bold(self.proj_packageJSON.version)}`));
|
|
44
45
|
}
|
|
45
46
|
|
|
47
|
+
if (self.options.lp || self.options.listpackages || self.options['-lp'] || self.options['-listpackages']) {
|
|
48
|
+
console.log(chalk.blue.bold(`Dependencies:`));
|
|
49
|
+
Object.keys(self.proj_packageJSON.dependencies || {})
|
|
50
|
+
.forEach((dep, i) => {
|
|
51
|
+
console.log(chalk.blue(`${dep} @ ${self.proj_packageJSON.dependencies[dep]}`));
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
console.log(chalk.blue.bold(`\nDev Dependencies:`));
|
|
55
|
+
Object.keys(self.proj_packageJSON.devDependencies || {})
|
|
56
|
+
.forEach((dep, i) => {
|
|
57
|
+
console.log(chalk.blue(`${dep} @ ${self.proj_packageJSON.devDependencies[dep]}`));
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
console.log(chalk.blue.bold(`\Peer Dependencies:`));
|
|
61
|
+
Object.keys(self.proj_packageJSON.peerDependencies || {})
|
|
62
|
+
.forEach((dep, i) => {
|
|
63
|
+
console.log(chalk.blue(`${dep} @ ${self.proj_packageJSON.peerDependencies[dep]}`));
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
46
69
|
if (self.options.clean) {
|
|
47
70
|
const NPM_INSTALL_FLAG = self.options['--no-optional'] || self.options['-no-optional'] || self.options['no-optional'] ? '--no-optional' : ''
|
|
48
71
|
const NPM_CLEAN = `rm -fr node_modules && rm -fr package-lock.json && npm cache clean --force && npm install ${NPM_INSTALL_FLAG} && npm rb`;
|