# @stefanprobst/unified-util-bridge

> [`unified`](https://unifiedjs.com/) plugin to process a tree in "bridge mode" and expose the result on a `data` property on the original processor's `VFile`.

Latest version **2.0.1** (published 2021-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @stefanprobst/unified-util-bridge
pnpm add @stefanprobst/unified-util-bridge
yarn add @stefanprobst/unified-util-bridge
bun add @stefanprobst/unified-util-bridge
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2021-11-08 |
| First published | 2020-10-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14.17 |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Stefan Probst |
| Maintainers | stefanprobst |

## Links

- npm: https://www.npmjs.com/package/@stefanprobst/unified-util-bridge
- Repository: https://github.com/stefanprobst/unified-util-bridge
- Homepage: https://github.com/stefanprobst/unified-util-bridge#readme
- Issues: https://github.com/stefanprobst/unified-util-bridge/issues
- npm.io page: https://npm.io/package/@stefanprobst/unified-util-bridge

## Recent versions

- 2.0.1 (latest) — 2021-11-08
- 2.0.0 — 2021-09-01
- 1.0.1 — 2020-10-11
- 1.0.0 — 2020-10-11

## README

# unified-util-bridge

[`unified`](https://unifiedjs.com/) plugin to process a tree in "bridge mode"
and expose the result on a `data` property on the original processor's `VFile`.

## How to install

```bash
yarn add @stefanprobst/unified-util-bridge
```

## How to use

The plugin takes two required parameters: the name of the `VFile` data property,
and a `unified` processor (compiler and transformers).

```js
import { unified } from 'unified'
import fromMarkdown from 'remark-parse'
import toMarkdown from 'remark-stringify'
import strip from 'strip-markdown'
import bridge from '@stefanprobst/unified-util-bridge'
import toHast from 'remark-rehype'
import toHtml from 'rehype-stringify'

const content = '**This** is *some* text.'

const processor = unified()
  .use(fromMarkdown)
  .use(bridge, 'plaintext', unified().use(strip).use(toMarkdown))
  .use(toHast)
  .use(toHtml)
const file = processor.processSync(content)
console.log(String(file)) // markdown transformed to html
console.log(file.data.plaintext) // markdown transformed to plaintext
```

---
_Source: https://npm.io/package/@stefanprobst/unified-util-bridge · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
