Comparing version 0.1.3 to 0.2.0
@@ -18,2 +18,3 @@ #! /usr/bin/env node | ||
.option('-P, --serverPort <n>', 'the port server forwarding to') | ||
.option('--postup <value>', 'postup script') | ||
.parse(process.argv); | ||
@@ -24,2 +25,12 @@ | ||
var cp = require('child_process'); | ||
var onexit = require('exit-hook'); | ||
var run = (script) => { | ||
if (!script) return; | ||
script = cp.exec(script); | ||
onexit(() => { | ||
script.kill(); | ||
}); | ||
}; | ||
var irc = require('./irc')(cmd); | ||
@@ -46,2 +57,4 @@ irc.on('error', e=>{throw Error(e)}); | ||
run(cmd.postup); | ||
}).catch(e=>{throw Error(e)}); | ||
@@ -62,2 +75,4 @@ } | ||
}); | ||
run(cmd.postup); | ||
} | ||
@@ -64,0 +79,0 @@ else { |
{ | ||
"name": "anygram", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"description": "Datagram forwarding behind NAT", | ||
@@ -16,2 +16,3 @@ "main": "index.js", | ||
"commander": "^2.9.0", | ||
"exit-hook": "^1.1.1", | ||
"node-stun": "^0.1.0", | ||
@@ -18,0 +19,0 @@ "slate-irc": "^0.9.0" |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
9769
197
4
3
+ Addedexit-hook@^1.1.1
+ Addedexit-hook@1.1.1(transitive)