is it possible to get 'import * as ..' syntax?
See original GitHub issueHi! First, many thanks, I discovered import-js yesterday and it made me 100% more happy.
I wonder if it possible to get that import declaration syntax:
import * as actions from './actions'
And, is there by any chance a possibility to get:
import * as { getTodos } from './actions'
without explicitly specify getTodos in namedExports?
Thanks
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:14 (3 by maintainers)
Top Results From Across the Web
import - JavaScript - MDN Web Docs - Mozilla
Name of the exports to be imported. The name can be either an identifier or a string literal, depending on what module-name declares...
Read more >Export and Import - The Modern JavaScript Tutorial
Export and import directives have several syntax variants. In the previous article we saw a simple use, now let's explore more examples.
Read more >JavaScript Import Explained - Tutorials - Yax.com
Export syntax. Module authors must export features before the code can be used with an import statement. Only features that are marked for...
Read more >Understanding Modules and Import and Export Statements in ...
The ECMAScript 2015 specification introduced modules to the JavaScript language, which allowed for the use of import and export statements.
Read more >Understanding ES6 Modules (Import / Export Syntax) in ...
Basically the import and export syntax is used everywhere where we write JavaScript and then transcompile and bundle it to “old-school” ...
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 Free
Top 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

Reopening sounds like a good plan. I have the same FUD, but it might just be one of those things you have to write down in code once before it all becomes clear.
While I personally try to stay away from wildcard imports, I don’t see why this couldn’t be added to import-js.
Since editor plugins are responsible for extracting the variable, you’d have to make some changes to them. We’ve actually been discussing letting the importjs process extract the variable, and only have the editor plugins tell us the location of the cursor (x, y). If you start there, you’d only have to change the code to extract the current word/variable once. Also, as a side-effect, the cursor approach would enable us to be smarter about resetting the cursor after replacing the file contents.