# from "module" import x

**URL:** <https://es.discourse.group/t/from-module-import-x/285>\
**Category:** 💡 Ideas\
**Created:** [March 31, 2020, 4:30pm UTC](https://es.discourse.group/t/from-module-import-x/285 "2020-03-31T16:30:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abounding](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/abounding/32/683_2.png) [@Abounding](https://es.discourse.group/u/Abounding)\
**Post date:** [March 31, 2020, 4:30pm UTC](https://es.discourse.group/t/from-module-import-x/285/1 "2020-03-31T16:30:54Z")

</div>

Would it be possible to have python style import statements where the module you're importing from comes first? That way, using an IDE you can autocomplete the module's exports.  
So, instead of having `import {x} from "module"` you would have `from "module" import {x}`.

Right now it is possible to get autocomplete if you go back to the curly braces, but sometimes it's a bit annoying. I know that python allows you to import with both ways, so my question is would there be any reason that javascript can't implement this?

---

<div class="post-metadata">

**Author:** ![ljharb](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/ljharb/32/8_2.png) [@ljharb](https://es.discourse.group/u/ljharb)\
**Post date:** [March 31, 2020, 6:46pm UTC](https://es.discourse.group/t/from-module-import-x/285/2 "2020-03-31T18:46:47Z")

</div>

I suspect no, that ship has sailed.

See [https://esdiscuss.org/topic/from-foo-import-foo](https://esdiscuss.org/topic/from-foo-import-foo) as well.

---

<div class="post-metadata">

**Author:** ![Abounding](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/abounding/32/683_2.png) [@Abounding](https://es.discourse.group/u/Abounding)\
**Post date:** [March 31, 2020, 8:14pm UTC](https://es.discourse.group/t/from-module-import-x/285/3 "2020-03-31T20:14:37Z")

</div>

That's unfortunate. I actually found the link you've posted to be very helpful, the snippet suggestion seems like it would solve the problem. Do you have any idea why syntax we have now was chosen?

---

<div class="post-metadata">

**Author:** ![ljharb](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/ljharb/32/8_2.png) [@ljharb](https://es.discourse.group/u/ljharb)\
**Post date:** [March 31, 2020, 8:26pm UTC](https://es.discourse.group/t/from-module-import-x/285/4 "2020-03-31T20:26:46Z")

</div>

I don't know why; hopefully someone can fill in the history.

(Note that even if I'd have preferred from-first syntax, I would be pretty opposed to having two distinct syntax choices for importing)

---

<div class="post-metadata">

**Author:** ![jridgewell](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/jridgewell/32/18_2.png) [@jridgewell](https://es.discourse.group/u/jridgewell)\
**Post date:** [April 2, 2020, 6:44pm UTC](https://es.discourse.group/t/from-module-import-x/285/5 "2020-04-02T18:44:24Z")

</div>

> [@Abounding](#):
>
> That way, using an IDE you can autocomplete the module's exports.

Note that IDE are free to do snippet insertion. Eg, writting "import " inserts:

```js
import [] from "[|]";
// ^ Insertion pointer here
// ^ Press Tab to jump to this location

```

That would allow you to write the module path first, then the imports can be auto-completed while you type in the import specifiers.
