# gatsby-remark-import-code

> ### Install

Latest version **0.1.1** (published 2019-08-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install gatsby-remark-import-code
pnpm add gatsby-remark-import-code
yarn add gatsby-remark-import-code
bun add gatsby-remark-import-code
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2019-08-29 |
| First published | 2019-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Rodrigo Pombo |
| Maintainers | pomber |

## Links

- npm: https://www.npmjs.com/package/gatsby-remark-import-code
- Repository: https://github.com/pomber/remark-import-code
- Homepage: https://github.com/pomber/remark-import-code#readme
- Issues: https://github.com/pomber/remark-import-code/issues
- npm.io page: https://npm.io/package/gatsby-remark-import-code

## Dependencies (2)

- [shell-quote](https://npm.io/package/shell-quote.md) ^1.6.1
- [unist-util-visit](https://npm.io/package/unist-util-visit.md) ^1.4.1

## Recent versions

- 0.1.1 (latest) — 2019-08-29
- 0.1.0 — 2019-08-29

## README

# gatsby-remark-import-code

### Install

```bash
$ npm install gatsby-remark-import-code
```

### Use

Use it together with [gatsby-plugin-mdx](https://www.gatsbyjs.org/packages/gatsby-plugin-mdx/). In `gatsby-config.js`:

```js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-mdx`,
      options: {
        gatsbyRemarkPlugins: [`gatsby-remark-import-code`]
      }
    }
  ]
};
```

It transforms md/mdx code blocks from this:

````md
```js file=./hello-world.js
```
````

into:

````md
```js
function helloWorld() {
  return "hello world";
}
```
````

### Related

- [gatsby-remark-embed-snippet](https://www.gatsbyjs.org/packages/gatsby-remark-embed-snippet/)

---
_Source: https://npm.io/package/gatsby-remark-import-code · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
