# How to import d3-selection and d3-selection-multi?

**URL:** <https://talk.observablehq.com/t/how-to-import-d3-selection-and-d3-selection-multi/967>\
**Category:** Help\
**Created:** [July 10, 2018, 2:48pm UTC](https://talk.observablehq.com/t/how-to-import-d3-selection-and-d3-selection-multi/967 "2018-07-10T14:48:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![petulla](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/petulla/32/802_2.png) [@petulla](https://talk.observablehq.com/u/petulla)\
**Post date:** [July 10, 2018, 2:48pm UTC](https://talk.observablehq.com/t/how-to-import-d3-selection-and-d3-selection-multi/967/1 "2018-07-10T14:48:23Z")

</div>

Title explains the question. How would you import them both and preserve the d3.\* namespace?

If bundling the modules, I’d include:

```
  export {select, selectAll} from "d3-selection";
  export * from "d3-selection-multi";
  export * from "d3-timer";

```

In my index.js file, assigning one namespace to all the exports. How can I do the same with Observable when it uses something more like CJS syntax for imports?

---

<div class="post-metadata">

**Author:** ![petulla](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/petulla/32/802_2.png) [@petulla](https://talk.observablehq.com/u/petulla)\
**Post date:** [July 10, 2018, 3:17pm UTC](https://talk.observablehq.com/t/how-to-import-d3-selection-and-d3-selection-multi/967/2 "2018-07-10T15:17:27Z")

</div>

Seems can just use

```
d3 = require(
           'd3-selection',
           'd3-selection-multi'
         )

```

Note: @tom Might be good to add this to the require tutorial.

---

<div class="post-metadata">

**Author:** ![tom](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/tom/32/2262_2.png) [@tom](https://talk.observablehq.com/u/tom)\
**Post date:** [July 16, 2018, 3:10am UTC](https://talk.observablehq.com/t/how-to-import-d3-selection-and-d3-selection-multi/967/3 "2018-07-16T03:10:42Z")

</div>

Indeed - the Intro notebook overlooked that detail! Thanks for pointing it out, I’ve added a new section under “require’s input” that explains multi-requires.
