Importing an entire module

suggest change

In addition to importing named members from a module or a module’s default export, you can also import all members into a namespace binding.

import * as test from './test'

test.doSomething()

All exported members are now available on the test variable. Non-exported members are not available, just as they are not available with named member imports.

Module specifiers are resolved by the host, not by the ECMAScript language. In a browser the specifier is a URL and normally includes the file extension. Bundlers and some Node setups accept a relative path such as './test'.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents