# remark-change-image-paths

> change image paths in your markdown files

Latest version **1.0.2** (published 2020-09-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install remark-change-image-paths
pnpm add remark-change-image-paths
yarn add remark-change-image-paths
bun add remark-change-image-paths
```

## 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 | 1.0.2 |
| Published | 2020-09-06 |
| First published | 2020-08-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | drulac |

## Links

- npm: https://www.npmjs.com/package/remark-change-image-paths
- Repository: https://github.com/Drulac/remark-change-image-paths
- Homepage: https://github.com/Drulac/remark-change-image-paths#readme
- Issues: https://github.com/Drulac/remark-change-image-paths/issues
- npm.io page: https://npm.io/package/remark-change-image-paths

## Dependencies (1)

- [unist-util-visit](https://npm.io/package/unist-util-visit.md) ^2.0.3

## Recent versions

- 1.0.2 (latest) — 2020-09-06
- 1.0.1 — 2020-08-30
- 1.0.0 — 2020-08-30

## README

# remark-change-image-paths

change image paths in your markdown files

# install

`npm install remark-change-image-paths --save`

# usage

```js
const fs = require('fs')
const unified = require('unified')
const markdown = require('remark-parse')
const remarkChangeImagesPath = require('remark-change-image-paths')(
	{
		search: /^/,
		replace: "/path/to/imagesFolder/",
	}
)
const remark2rehype = require('remark-rehype')
const stringify = require('rehype-stringify')

unified()
        .use(markdown)
        .use(remark2rehype)
        .use(remarkChangeImagesPath)
        .use(stringify)
        .process(
                `![](img.png)`,
                function (err, file) {
                        if (err) throw err
                        console.log(String(file))
                }
        )
```

will output :

```html
<img src="/path/to/imagesFolder/img.png">
```

# credits

this if a fork from [@h2xd/remark-change-image-paths](https://www.npmjs.com/package/@h2xd/remark-change-image-paths)

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