# babel-plugin-dynamic-import-node-sync

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

Latest version **2.0.1** (published 2018-02-03) · MIT license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2018-02-03 |
| First published | 2017-04-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 26 |
| Author | Zlatko Fedor |
| Maintainers | zlatkofedor |
| Keywords | babel, plugin, dynamic, import, node, sync, ssr, react-router |

## Links

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

## Dependencies (1)

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

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 2.0.1 (latest) — 2018-02-03
- 1.0.1 — 2017-04-14

## README

# babel-plugin-dynamic-import-node-sync

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

I am using it for server-side rendering.

## Difference from babel-plugin-dynamic-import-node

**babel-plugin-dynamic-import-node-sync**
```
import(SOURCE) => require(SOURCE)
```

**babel-plugin-dynamic-import-node**
```
import(SOURCE) => Promise.resolve().then(() => require(SOURCE))
```

## Installation

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

## Usage

### Via `.babelrc` (Recommended)

**.babelrc**

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

### Via CLI

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

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