node-power-user 0.0.31 → 0.0.32
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/index.js +9 -9
- package/package.json +35 -3
- package/src/index.js +9 -9
package/dist/index.js
CHANGED
|
@@ -73,29 +73,29 @@ Main.prototype.process = async function (options) {
|
|
|
73
73
|
self.options[arg] = argv[arg]
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
if (self.options.d || self.options.debug || process.env.NPU_LOG === 'true') {
|
|
76
|
+
if (self.options.d || self.options.debug || self.options._.includes('debug') || process.env.NPU_LOG === 'true') {
|
|
77
77
|
console.log('argv', argv);
|
|
78
78
|
console.log('options', self.options);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
if (self.options.wait) {
|
|
81
|
+
if (self.options.wait || self.options._.includes('wait')) {
|
|
82
82
|
const time = parseInt(typeof self.options.wait === 'number' ? self.options.wait : 1000);
|
|
83
83
|
self.log(chalk.blue(`Waiting ${time}...`));
|
|
84
84
|
await powertools.wait(time);
|
|
85
85
|
self.log(chalk.green(`Done waiting`));
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
if (self.options.v || self.options.version) {
|
|
88
|
+
if (self.options.v || self.options.version || self.options._.includes('version')) {
|
|
89
89
|
self.log(chalk.blue(`Node Power User is v${chalk.bold(self.npu_packageJSON.version)}`));
|
|
90
90
|
return self.npu_packageJSON.version;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
if (self.options.pv || self.options.project || self.options['project-version']) {
|
|
93
|
+
if (self.options.pv || self.options.project || self.options['project-version'] || self.options._.includes('project')) {
|
|
94
94
|
self.log(chalk.blue(`The current project (${chalk.bold(self.proj_packageJSON.name)}) is v${chalk.bold(self.proj_packageJSON.version)}`));
|
|
95
95
|
return self.proj_packageJSON.version;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
if (self.options.lp || self.options.listpackages || self.options['list-packages']) {
|
|
98
|
+
if (self.options.lp || self.options.listpackages || self.options['list-packages'] || self.options._.includes('listpackages')) {
|
|
99
99
|
self.log(chalk.blue.bold(`Dependencies:`));
|
|
100
100
|
|
|
101
101
|
Object.keys(self.proj_packageJSON.dependencies || {})
|
|
@@ -122,7 +122,7 @@ Main.prototype.process = async function (options) {
|
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
if (self.options.out || self.options.outdated || self.options.match) {
|
|
125
|
+
if (self.options.out || self.options.outdated || self.options.match || self.options._.includes('out') || self.options._.includes('outdated') || self.options._.includes('match')) {
|
|
126
126
|
// self.log(chalk.blue.bold(`Outdated:`));
|
|
127
127
|
// self.log(chalk.green(`name: package = installed`));
|
|
128
128
|
|
|
@@ -227,7 +227,7 @@ Main.prototype.process = async function (options) {
|
|
|
227
227
|
return response;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
if (self.options.global || self.options.g) {
|
|
230
|
+
if (self.options.global || self.options.g || self.options._.includes('global')) {
|
|
231
231
|
const parentPath = `/Users/${os.userInfo().username}/.nvm/versions/node`;
|
|
232
232
|
const versions = jetpack.list(parentPath);
|
|
233
233
|
const currentNode = process.versions.node;
|
|
@@ -303,7 +303,7 @@ Main.prototype.process = async function (options) {
|
|
|
303
303
|
return response;
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
-
if (self.options.clean) {
|
|
306
|
+
if (self.options.clean || self.options._.includes('clean')) {
|
|
307
307
|
const NPM_INSTALL_FLAG = self.options['no-optional'] || self.options['nooptional'] ? '--no-optional' : ''
|
|
308
308
|
const NPM_CLEAN = `rm -fr node_modules && rm -fr package-lock.json && npm cache clean --force && npm install ${NPM_INSTALL_FLAG} && npm rb`;
|
|
309
309
|
|
|
@@ -318,7 +318,7 @@ Main.prototype.process = async function (options) {
|
|
|
318
318
|
})
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
if (self.options.bump) {
|
|
321
|
+
if (self.options.bump || self.options._.includes('bump')) {
|
|
322
322
|
return bump(self);
|
|
323
323
|
}
|
|
324
324
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-power-user",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"description": "Easy tools for every Node.js developer!",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -50,5 +50,37 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"mocha": "^8.4.0",
|
|
52
52
|
"prepare-package": "^0.0.16"
|
|
53
|
-
}
|
|
54
|
-
|
|
53
|
+
},
|
|
54
|
+
"allDependencies": {
|
|
55
|
+
"mocha": "^8.4.0",
|
|
56
|
+
"prepare-package": "^0.0.16",
|
|
57
|
+
"chalk": "^4.1.2",
|
|
58
|
+
"cli-progress": "^3.11.2",
|
|
59
|
+
"fs-jetpack": "^4.3.1",
|
|
60
|
+
"inquirer": "^8.2.4",
|
|
61
|
+
"json5": "^2.2.1",
|
|
62
|
+
"keychain": "^1.3.0",
|
|
63
|
+
"lodash": "^4.17.21",
|
|
64
|
+
"node-powertools": "^0.0.21",
|
|
65
|
+
"npm-api": "^1.0.1",
|
|
66
|
+
"semver": "^7.3.7",
|
|
67
|
+
"table": "^6.8.0",
|
|
68
|
+
"yargs": "^16.2.0"
|
|
69
|
+
},
|
|
70
|
+
"allDependenciesKeys": [
|
|
71
|
+
"mocha",
|
|
72
|
+
"prepare-package",
|
|
73
|
+
"chalk",
|
|
74
|
+
"cli-progress",
|
|
75
|
+
"fs-jetpack",
|
|
76
|
+
"inquirer",
|
|
77
|
+
"json5",
|
|
78
|
+
"keychain",
|
|
79
|
+
"lodash",
|
|
80
|
+
"node-powertools",
|
|
81
|
+
"npm-api",
|
|
82
|
+
"semver",
|
|
83
|
+
"table",
|
|
84
|
+
"yargs"
|
|
85
|
+
]
|
|
86
|
+
}
|
package/src/index.js
CHANGED
|
@@ -73,29 +73,29 @@ Main.prototype.process = async function (options) {
|
|
|
73
73
|
self.options[arg] = argv[arg]
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
if (self.options.d || self.options.debug || process.env.NPU_LOG === 'true') {
|
|
76
|
+
if (self.options.d || self.options.debug || self.options._.includes('debug') || process.env.NPU_LOG === 'true') {
|
|
77
77
|
console.log('argv', argv);
|
|
78
78
|
console.log('options', self.options);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
if (self.options.wait) {
|
|
81
|
+
if (self.options.wait || self.options._.includes('wait')) {
|
|
82
82
|
const time = parseInt(typeof self.options.wait === 'number' ? self.options.wait : 1000);
|
|
83
83
|
self.log(chalk.blue(`Waiting ${time}...`));
|
|
84
84
|
await powertools.wait(time);
|
|
85
85
|
self.log(chalk.green(`Done waiting`));
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
if (self.options.v || self.options.version) {
|
|
88
|
+
if (self.options.v || self.options.version || self.options._.includes('version')) {
|
|
89
89
|
self.log(chalk.blue(`Node Power User is v${chalk.bold(self.npu_packageJSON.version)}`));
|
|
90
90
|
return self.npu_packageJSON.version;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
if (self.options.pv || self.options.project || self.options['project-version']) {
|
|
93
|
+
if (self.options.pv || self.options.project || self.options['project-version'] || self.options._.includes('project')) {
|
|
94
94
|
self.log(chalk.blue(`The current project (${chalk.bold(self.proj_packageJSON.name)}) is v${chalk.bold(self.proj_packageJSON.version)}`));
|
|
95
95
|
return self.proj_packageJSON.version;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
if (self.options.lp || self.options.listpackages || self.options['list-packages']) {
|
|
98
|
+
if (self.options.lp || self.options.listpackages || self.options['list-packages'] || self.options._.includes('listpackages')) {
|
|
99
99
|
self.log(chalk.blue.bold(`Dependencies:`));
|
|
100
100
|
|
|
101
101
|
Object.keys(self.proj_packageJSON.dependencies || {})
|
|
@@ -122,7 +122,7 @@ Main.prototype.process = async function (options) {
|
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
if (self.options.out || self.options.outdated || self.options.match) {
|
|
125
|
+
if (self.options.out || self.options.outdated || self.options.match || self.options._.includes('out') || self.options._.includes('outdated') || self.options._.includes('match')) {
|
|
126
126
|
// self.log(chalk.blue.bold(`Outdated:`));
|
|
127
127
|
// self.log(chalk.green(`name: package = installed`));
|
|
128
128
|
|
|
@@ -227,7 +227,7 @@ Main.prototype.process = async function (options) {
|
|
|
227
227
|
return response;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
if (self.options.global || self.options.g) {
|
|
230
|
+
if (self.options.global || self.options.g || self.options._.includes('global')) {
|
|
231
231
|
const parentPath = `/Users/${os.userInfo().username}/.nvm/versions/node`;
|
|
232
232
|
const versions = jetpack.list(parentPath);
|
|
233
233
|
const currentNode = process.versions.node;
|
|
@@ -303,7 +303,7 @@ Main.prototype.process = async function (options) {
|
|
|
303
303
|
return response;
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
-
if (self.options.clean) {
|
|
306
|
+
if (self.options.clean || self.options._.includes('clean')) {
|
|
307
307
|
const NPM_INSTALL_FLAG = self.options['no-optional'] || self.options['nooptional'] ? '--no-optional' : ''
|
|
308
308
|
const NPM_CLEAN = `rm -fr node_modules && rm -fr package-lock.json && npm cache clean --force && npm install ${NPM_INSTALL_FLAG} && npm rb`;
|
|
309
309
|
|
|
@@ -318,7 +318,7 @@ Main.prototype.process = async function (options) {
|
|
|
318
318
|
})
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
if (self.options.bump) {
|
|
321
|
+
if (self.options.bump || self.options._.includes('bump')) {
|
|
322
322
|
return bump(self);
|
|
323
323
|
}
|
|
324
324
|
|