1 |
|
2 |
|
3 | const path = require('path')
|
4 | const CollectAndRead = require(path.resolve('collect-and-read.js'))
|
5 | const 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 | `)
|
13 | cmd.on('ready', function () {
|
14 | cmd.cleanup()
|
15 | })
|
16 | process.on('exit', function () {
|
17 | cmd.cleanup()
|
18 | })
|