Skip to content

Instantly share code, notes, and snippets.

@sota1235
Created July 15, 2020 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sota1235/ff0785dccf821e29a6ab19b5defd1857 to your computer and use it in GitHub Desktop.
Save sota1235/ff0785dccf821e29a6ab19b5defd1857 to your computer and use it in GitHub Desktop.
(async () => {
const test = await new Promise((resolve) => {
console.log('test1');
process.on('message', (message) => {
resolve(message.payload);
});
console.log('test2');
if (process.send !== undefined) {
process.send('');
console.log('test4');
}
console.log('test3');
});
console.log('test5');
})().then(() => console.log('finished'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment