>
>
>> And then "* as" would fit in naturally:
>>
>> import * as FS, readFile from "node:fs";
>>
>
> I'm assuming this import the moduleObject?
>
Right - "import * as ..." is the new syntax for importing all names into a
namespace binding ("FS" in this case), approved at the last TC39 meeting.
> You still miss the ability to import a single-export module and naming it
> whatever you want to. How would recreate the following node code in ES6?
>
> ```js
> //nodeJS
> var $ = require("jQuery");
>
> //ES6
> import {jQuery as $} from "jQuery";
> ```
>
>
"jQuery" would just export "$" as a name (an alias for the "jQuery"
variable), like it currently injects "$" into the global object.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss