ES6 import support?
See original GitHub issueHey y’all,
Thanks for your work on this lib. Any plans for ES6 import support in the near future? If it’s something actively being worked on I’m gonna wait, otherwise I may look into possibly PRing?
EG
import { uuidv1 } from 'node-uuid'
Issue Analytics
- State:
- Created 6 years ago
- Reactions:16
- Comments:45 (17 by maintainers)
Top Results From Across the Web
import - JavaScript - MDN Web Docs - Mozilla
The static import declaration is used to import read-only live bindings which are exported by another module. The imported bindings are ...
Read more >ES6 Modules and How to Use Import and Export in JavaScript
The ES2015 (ES6) edition of the JavaScript standard gives us native support for modules with the import and export syntax.
Read more >JavaScript modules via script tag | Can I use... Support tables ...
Loading JavaScript module scripts (aka ES6 modules) using <script type="module"> Includes support for the nomodule attribute. Usage % of. all users, all tracked ......
Read more >How to use an ES6 import in Node.js? - GeeksforGeeks
Introduction to ES6 import: The import statement is used to import modules that are exported by some other module. A module is a...
Read more >16. Modules - Exploring JS
The imports of an ES6 module are read-only views on the exported entities. That means that the connections to variables declared inside module...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@broofa
import uuid from 'uuid/v4';
syntax does not work, at least in aTypescript v3
project running onNode v10.9.0
(without webpack nor babel, onlyts-node
to compile/run Typescript)I get the following error:
TypeError: v4_1.uuid is not a function
on the other hand,
import {v4 as uuid} from 'uuid';
works as expected(tested on
uuid v3.3.2
)As noted in the README, importing
uuid
is deprecated. Instead, importuuid/<version>
. E.g. to import the v1 generator using ES6 notation:import uuidv1 from 'uuid/v1';
Edit: Recommended incantation is now: