UNPKG

444 BJavaScriptView Raw
1'use strict'
2
3const path = require('path')
4const CollectAndRead = require(path.resolve('collect-and-read.js'))
5const cmd = new CollectAndRead({}, '-e', `
6 setInterval(() => {}, 100)
7 process.once('SIGINT', function () {
8 console.log('SIGINT received')
9 process.kill(process.pid, 'SIGINT')
10 })
11 console.log('listening for SIGINT')
12`)
13cmd.on('ready', function () {
14 cmd.cleanup()
15})
16process.on('exit', function () {
17 cmd.cleanup()
18})