Files
30-seconds-of-code/node_modules/gatsby-telemetry/lib/flush.js
2019-08-20 15:52:05 +02:00

20 lines
363 B
JavaScript

"use strict";
const {
join
} = require(`path`);
const {
fork
} = require(`child_process`);
module.exports = async () => {
// Submit events on background w/o blocking the main process
// nor relying on it's lifecycle
const forked = fork(join(__dirname, `send.js`), {
detached: true,
stdio: `ignore`,
execArgv: []
});
forked.unref();
};