Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ESM environment for node #159

Open
jkrems opened this issue Jan 17, 2020 · 0 comments
Open

Create ESM environment for node #159

jkrems opened this issue Jan 17, 2020 · 0 comments

Comments

@jkrems
Copy link
Contributor

jkrems commented Jan 17, 2020

Right now the globals for node include identifiers that aren't real globals but are artifacts of the fact that historically most code has been running inside of CommonJS wrapper functions.

A "true" globals environment for node may look like this:

 	"node": {
-		"__dirname": false,
-		"__filename": false,
 		"Buffer": false,
 		"clearImmediate": false,
 		"clearInterval": false,
 		"clearTimeout": false,
 		"console": false,
-		"exports": true,
 		"global": false,
 		"Intl": false,
-		"module": false,
 		"process": false,
 		"queueMicrotask": false,
-		"require": false,
 		"setImmediate": false,
 		"setInterval": false,
 		"setTimeout": false,
 		"TextDecoder": false,
 		"TextEncoder": false,
 		"URL": false,
 		"URLSearchParams": false
 	},

Since the name "node" is already taken, maybe it could be called "nodeBase"? Or "nodeButOnlyTheActualGlobals". I honestly don't have a good name yet.

Happy to create a PR if the overall direction makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant