# babel-plugin-dynamic-import-node-babel-7

> Babel plugin to transpile import() to a deferred require(), for node

Latest version **2.0.7** (published 2018-03-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-dynamic-import-node-babel-7
pnpm add babel-plugin-dynamic-import-node-babel-7
yarn add babel-plugin-dynamic-import-node-babel-7
bun add babel-plugin-dynamic-import-node-babel-7
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.7 |
| Published | 2018-03-16 |
| First published | 2017-11-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 121.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Jordan Gensler |
| Maintainers | mike3run |
| Keywords | babel, plugin, dynamic, import, node |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-dynamic-import-node-babel-7
- Repository: https://github.com/mike3run/babel-plugin-dynamic-import-node-babel-7
- Homepage: https://github.com/mike3run/babel-plugin-dynamic-import-node-babel-7#readme
- Issues: https://github.com/mike3run/babel-plugin-dynamic-import-node-babel-7/issues
- npm.io page: https://npm.io/package/babel-plugin-dynamic-import-node-babel-7

## Dependencies (1)

- [@babel/plugin-syntax-dynamic-import](https://npm.io/package/@babel/plugin-syntax-dynamic-import.md) ^7.0.0-beta.42

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.0.7 (latest) — 2018-03-16
- 2.0.6 — 2018-02-22
- 2.0.5 — 2018-02-07
- 2.0.4 — 2018-01-27
- 2.0.3 — 2018-01-15
- 2.0.2 — 2018-01-11
- 2.0.1 — 2017-11-26
- 2.0.0 — 2017-11-26

## README

# babel-plugin-dynamic-import-node

## FORK OF THE ORIGINAL TO TEST WITH BABEL 7

If you're looking for the original one, check on: [Github](https://github.com/airbnb/babel-plugin-dynamic-import-node)
This fork was created to add support for Babel 7: [Github](https://github.com/mike3run/babel-plugin-dynamic-import-node-babel-7)

Babel plugin to transpile `import()` to a deferred `require()`, for node. Matches the [proposed spec](https://github.com/domenic/proposal-import-function).

**NOTE:** Babylon >= v6.12.0 is required to correct parse dynamic imports.

## Installation

```sh
$ npm install babel-plugin-dynamic-import-node-babel-7 --save-dev
```

## Usage

### Via `.babelrc` (Recommended)

**.babelrc**

```json
{
  "plugins": ["dynamic-import-node-babel-7"]
}
```

### Via CLI

```sh
$ babel --plugins dynamic-import-node script.js
```

### Via Node API

```javascript
require('babel-core').transform('code', {
  plugins: ['dynamic-import-node']
});
```

### Code Example
```javascript
Promise.all([
  import('./lib/import1'),
  import('./lib/import2')
 ]).then(([
   Import1,
   Import2
  ]) => {
   console.log(Import1);
   /* CODE HERE*/
  });
```

---
_Source: https://npm.io/package/babel-plugin-dynamic-import-node-babel-7 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
