Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clean-scripts

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clean-scripts - npm Package Compare versions

Comparing version 1.9.0-alpha.2 to 1.9.0-alpha.3

30

dist/index.js

@@ -10,3 +10,2 @@ "use strict";

const packageJson = tslib_1.__importStar(require("../package.json"));
const psTree = require('ps-tree');
const defaultConfigName = 'clean-scripts.config.js';

@@ -49,4 +48,22 @@ function showToolVersion() {

subProcess.kill('SIGINT');
psTree(subProcess.pid, (_err, children) => {
childProcess.spawn('kill', ['-9'].concat(children.map((p) => p.PID)));
if (process.platform === 'win32') {
childProcess.exec(`taskkill -F -T -PID ${subProcess.pid}`);
}
}
if (process.platform === 'darwin' || process.platform === 'linux') {
childProcess.exec('ps -l', (error, stdout) => {
if (error) {
console.log(error);
}
else {
const ps = stdout.split('\n')
.map(s => s.split(' ').filter(s => s))
.filter((s, i) => i > 0 && s.length >= 2)
.map(s => ({ pid: +s[1], ppid: +s[2] }));
const result = [];
collectPids(process.pid, ps, result);
for (const pid of result) {
childProcess.exec(`kill -9 ${pid}`);
}
}
});

@@ -69,1 +86,8 @@ }

});
function collectPids(pid, ps, result) {
const children = ps.filter(p => p.ppid === pid);
for (const child of children) {
result.push(child.pid);
collectPids(child.pid, ps, result);
}
}

3

package.json
{
"name": "clean-scripts",
"version": "1.9.0-alpha.2",
"version": "1.9.0-alpha.3",
"description": "A CLI tool to make scripts in package.json clean.",

@@ -46,3 +46,2 @@ "main": "dist/core.js",

"pretty-ms": "3.1.0",
"ps-tree": "1.1.0",
"tslib": "1.9.1"

@@ -49,0 +48,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc