Skip to content

Instantly share code, notes, and snippets.

@davidmarkclements
Last active December 17, 2021 18:31
Show Gist options
  • Save davidmarkclements/98669c376f945df8a8f5ea17f0cb0b2c to your computer and use it in GitHub Desktop.
Save davidmarkclements/98669c376f945df8a8f5ea17f0cb0b2c to your computer and use it in GitHub Desktop.
parent-module ESM
import parentModule from 'parent-module'
console.log(parentModule()) // prints "node:internal/modules/esm/module_job" (Node 16.13.1)
import './a.mjs'
{
"name": "foo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"parent-module": "^3.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment