0

In Python I can import the names in my module as qualified

import myModule

or unqualified

from myModule import *

In Node.js, I can import as qualified

var myModule = require('myModule')

Is there a way to import names unqualified?

twinlakes
  • 9,438
  • 6
  • 31
  • 42

1 Answers1

-1

You can do that in ES6: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import

ES6 imports are not supported in node.js at this point though. You could get it by writing ES6 code and transpiling it with babel, for example https://babeljs.io/

ralh
  • 2,514
  • 1
  • 13
  • 19