Tabnine Logo For Javascript
ChildProcess.kill
Code IndexAdd Tabnine to your IDE (free)

How to use
kill
function
in
ChildProcess

Best JavaScript code snippets using child_process.ChildProcess.kill(Showing top 15 results out of 315)

origin: GoogleChromeLabs/ndb

p.kill();
origin: fabienvauchelles/scrapoxy

stop() {
    winston.debug('[TestServer] stop');

    return new Promise((resolve) => {
      if (!this._child || this._child.killed) {
        resolve();
      }

      this._child.on('close', () => resolve());

      this._child.kill();
      this._child = void 0;
    });
  }
origin: TryGhost/Ghost-CLI

cleanup() {
    if (!this.child) {
      return;
    }

    try {
      this.child.kill();
    } catch (e) {
      if (!this.sudo || e.code !== 'EPERM') {
        throw e;
      }
    }
  }
origin: LCMApps/drover

/**
   * @param force
   * @returns {Promise}
   */
  async quit(force = false) {
    if (force) {
      this._worker.process.kill('SIGKILL');
      return Promise.resolve();
    }

    await this._sendMessage(Commands.QUIT);

    return this._assureStatusSequence([WorkerStatuses.SHUTTING_DOWN, WorkerStatuses.SHUTTED_DOWN]);
  }
origin: keymetrics/pmx

it('should fork app and receive data', function(done) {
  var app = forkHistogram();

  app.on('message', function(pck) {
   should(pck.data['min'].historic).eql(true);

   if (pck.data.mean && pck.data.mean.agg_type == 'avg' &&
     pck.data.min  && pck.data.min.agg_type == 'min' &&
     pck.data.test && pck.data.test.agg_type == 'sum') {
    app.kill();
    done();
   }
  });
 });
origin: JerryC8080/Memeye

// Handle child process's error
  dashboardProcess.once('error', (err) => {

    // Kill child process once it occur error.
    logger.error(`DashboardProcess occur an error: ${err.toString()}`);
    logger.error(`DashboardProcess should be stopping......`);
    dashboardProcess.kill();
  }).once('exit', (code, signal) => {

    // Stop collector while child process exit.
    logger.error(`DashboardProcess exited by code: ${code}`);
    logger.error(`Collector has been stopped.`);
    collector.stop();
  });
origin: metarhia/jstp

function handleEvent(ifaceName, eventName) {
 test.equals(ifaceName, iface, 'interface name must match');
 test.equals(eventName, event, 'event name must match');
 client.kill();
 server.close();
}
origin: DataDog/dd-trace-js

async function run (profilerEnabled) {
 const port = await getPort()
 const url = new URL(`http://localhost:${port}/hello`)
 const server = await createServer(profilerEnabled, url)

 title(`Benchmark (enabled=${profilerEnabled})`)

 await getUsage(url)

 const net = await benchmark(url.href, 15000)
 const cpu = await getUsage(url)

 server.kill('SIGINT')

 return { cpu, net }
}
origin: emersonsoares/spotydrive

child.on('message', message => {
 oauth2.token(message)
 console.log('Login successful')
 child.kill()
})
origin: mirekwebrtc/nodejs-docs-samples

test(`should request and handle a greeting locally`, async (t) => {
 const PORT = 50051;
 const server = childProcess.exec(`${serverCmd} -p ${PORT}`, { cwd: cwd });

 await delay(1000);
 console.log(`${clientCmd} -h localhost:${PORT} -k ${API_KEY}`);
 const clientOutput = await runAsync(`${clientCmd} -h localhost:${PORT} -k ${API_KEY}`, cwd);
 t.regex(clientOutput, /Hello world/);
 server.kill();
});
origin: wangding/nodejs-demo

setTimeout(() => {
 child.kill('SIGINT');
 process.exit();
}, 6000);
origin: keymetrics/pmx

it('should instanciate metric sample app', function(done) {
  var app = forkMetric();

  app.on('message', function(pck) {
   // Will iterate two times, metric change the value to false
   should(pck.data['Realtime user'].value).eql(2);
   should(pck.data['Realtime user'].unit).eql('kb');
   should(pck.data['Realtime user'].historic).eql(false);
   should(pck.data['Realtime user'].type).eql('v8/smthing');
   app.kill()
   done()
  })
 });
origin: xinshao926/nodejs-docs-samples

it(`should request and handle a greeting locally using a JWT Auth Token`, async () => {
 const PORT = 50051;
 const server = childProcess.exec(`${serverCmd} -p ${PORT}`, {cwd: cwd});

 await delay(1000);
 const clientOutput = await tools.runAsync(
  `${clientCmd} -h localhost:${PORT} -j ${JWT_AUTH_TOKEN}`,
  cwd
 );
 assert.ok(new RegExp('Hello world').test(clientOutput));
 server.kill();
});
origin: bottlerockets/legacy-bottlerockets

kill() {
  if (this._process !== undefined) {
   this._process.kill('SIGINT')
   this._process.kill('SIGTERM')
   this._process = undefined
  }
 }
origin: xinshao926/nodejs-docs-samples

it(`should request and handle a greeting locally using a JWT Auth Token`, async () => {
 const PORT = 50051;
 const server = childProcess.exec(`${serverCmd} -p ${PORT}`, {cwd: cwd});

 await delay(1000);
 const clientOutput = await tools.runAsync(
  `${clientCmd} -h localhost:${PORT} -j ${JWT_AUTH_TOKEN}`,
  cwd
 );
 assert.ok(new RegExp('Hello world').test(clientOutput));
 server.kill();
});
child_processChildProcesskill

Most used child_process functions

  • exec
  • spawn
  • execSync
  • ChildProcess.on
  • ChildProcessWithoutNullStreams.stdout
  • ChildProcessWithoutNullStreams.stderr,
  • fork,
  • ChildProcess.pid,
  • ChildProcess.stdout,
  • execFile,
  • ChildProcess.stderr,
  • ChildProcessWithoutNullStreams.kill,
  • spawnSync,
  • ChildProcess.kill,
  • ChildProcessWithoutNullStreams.stdin,
  • ChildProcess.send,
  • ExecException.message,
  • ChildProcess.once,
  • SpawnSyncReturns.status

Popular in JavaScript

  • glob
    a little globber
  • qs
    A querystring parser that supports nesting and arrays, with a depth limit
  • fs
  • fs-extra
    fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.
  • mongodb
    The official MongoDB driver for Node.js
  • aws-sdk
    AWS SDK for JavaScript
  • commander
    the complete solution for node.js command-line programs
  • webpack
    Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
  • path
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now