# remark-asset-copy

> Copy assets from markdown to folder

Latest version **0.0.1** (published 2020-05-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install remark-asset-copy
pnpm add remark-asset-copy
yarn add remark-asset-copy
bun add remark-asset-copy
```

## 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.0.1 |
| Published | 2020-05-19 |
| First published | 2020-05-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Johan Bleuzen |
| Maintainers | jbleuzen |

## Links

- npm: https://www.npmjs.com/package/remark-asset-copy
- Repository: https://github.com/jbleuzen/remark-asset-copy
- Homepage: https://github.com/jbleuzen/remark-asset-copy#readme
- Issues: https://github.com/jbleuzen/remark-asset-copy/issues
- npm.io page: https://npm.io/package/remark-asset-copy

## Dependencies (3)

- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.0
- [node-html-parser](https://npm.io/package/node-html-parser.md) ^1.2.16
- [unist-util-visit](https://npm.io/package/unist-util-visit.md) ^2.0.2

## Recent versions

- 0.0.1 (latest) — 2020-05-19

## README

# remark-asset-copy

Copy assets from markdown to a folder inside `public`.

I created this because there was no easy way to have this type of file structure with [next.js]() without using `require()`.

```text
/
|- content
|   |-post-slug
|   |   |- index.md
|   |   |- image.jpg
```

## How to use

Basic example :

``` js
import remark from 'remark';
import vfile from 'vfile';
import frontmatter from 'remark-frontmatter';
import assetCopy from 'remark-asset-copy';

const processedContent = await remark()
  .use(frontmatter)
  .use(html)
  .use(copy, {
    destination: "public/assets",
  })
  .process(vfile.readSync(fullPath));
const contentHtml = processedContent.toString();
```

## Tests

Basic testing is implemented but a deeper tests must be written

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