node-power-user 2.1.0 → 2.1.1

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/README.md CHANGED
@@ -93,6 +93,12 @@ Use `--force` to bypass Socket protection (not recommended):
93
93
  npu i <package> --force
94
94
  ```
95
95
 
96
+ ### Audit
97
+ Run a Socket supply chain audit on your current dependency tree.
98
+ ```shell
99
+ npu audit
100
+ ```
101
+
96
102
  ### Outdated Packages
97
103
  Compare the versions of installed modules to those in your package.json. When you choose to update, the install step and a full post-install audit are both wrapped with Socket for supply chain protection.
98
104
  ```shell
package/dist/cli.js CHANGED
@@ -8,6 +8,7 @@ const ALIASES = {
8
8
  bump: ['-b', '--bump'],
9
9
  clean: ['-c', '--clean'],
10
10
  global: ['-g', '--global'],
11
+ audit: ['--audit'],
11
12
  install: ['-i', '--install', 'i'],
12
13
  open: ['--open', 'repo', '--repo'],
13
14
  outdated: ['-o', 'out', '--outdated', '-u', '--update', 'up', 'update'],
@@ -0,0 +1,18 @@
1
+ // Libraries
2
+ const logger = new (require('../lib/logger'))('node-power-user');
3
+ const socket = require('../lib/socket');
4
+
5
+ // Module
6
+ module.exports = async function (options) {
7
+ // Check socket status upfront (blocks if not installed unless --force)
8
+ await socket.check({ force: options.force });
9
+
10
+ // Run audit
11
+ logger.log('Running Socket audit on current dependency tree...');
12
+
13
+ try {
14
+ await socket.audit({ force: options.force });
15
+ } catch (e) {
16
+ logger.error(e.message);
17
+ }
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-power-user",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Easy tools for every Node.js developer!",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {