Skip to content

Instantly share code, notes, and snippets.

@shubham-sharmas
Created November 16, 2023 18:42
Show Gist options
  • Save shubham-sharmas/625e71a16f514ce77a8beb50e9a36548 to your computer and use it in GitHub Desktop.
Save shubham-sharmas/625e71a16f514ce77a8beb50e9a36548 to your computer and use it in GitHub Desktop.
This gist demonstrates how we can import Node.js worker threads in ES5 using require and ES6 using import statement.
/ ES5
const worker = require('node:worker_threads');
// ES6
import worker from 'node:worker_threads';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment