Socket
Socket
Sign inDemoInstall

tsc-watch

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsc-watch - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

example/main.js

3

package.json
{
"name": "tsc-watch",
"version": "1.0.5",
"version": "1.0.6",
"description": "The TypeScirpt compiler with onSuccess command",

@@ -28,4 +28,5 @@ "main": "tsc-watch.js",

"cross-spawn": "^5.1.0",
"ps-tree": "^1.1.0",
"typescript": "*"
}
}

@@ -6,2 +6,3 @@ #!/usr/bin/env node

const spawn = require('cross-spawn');
const killer = require('./killer');

@@ -57,17 +58,21 @@ const compilationStartedRegex = /Starting incremental compilation/;

function runCommand(fullCommand) {
const parts = fullCommand.split(' ').filter(a => a.length > 0);
return spawn(parts[0], parts.slice(1), {stdio: 'inherit'})
if (fullCommand) {
const parts = fullCommand.split(' ').filter(a => a.length > 0);
return spawn(parts[0], parts.slice(1), {stdio: 'inherit'})
}
}
function killAllProcesses() {
const promises = [];
if (firstSuccessProcess) {
firstSuccessProcess.kill();
firstSuccessProcess = null;
promises.push(killer(firstSuccessProcess).then(() => firstSuccessProcess = null));
}
if (successProcess) {
successProcess.kill();
successProcess = null;
promises.push(killer(successProcess).then(() => successProcess = null));
}
return Promise.all(promises);
}
let allArgs = process.argv;

@@ -120,9 +125,10 @@ // onSuccess

} else {
killAllProcesses();
if (firstTime && onFirstSuccessCommand) {
firstTime = false;
firstSuccessProcess = runCommand(onFirstSuccessCommand);
} else {
successProcess = runCommand(onSuccessCommand);
}
killAllProcesses().then(() => {
if (firstTime && onFirstSuccessCommand) {
firstTime = false;
firstSuccessProcess = runCommand(onFirstSuccessCommand);
} else {
successProcess = runCommand(onSuccessCommand);
}
});
}

@@ -129,0 +135,0 @@ }

Sorry, the diff of this file is not supported yet

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