# @chailotl/remark-videos

> A remark plugin to embed videos with ![]()

Latest version **1.0.4** (published 2024-02-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @chailotl/remark-videos
pnpm add @chailotl/remark-videos
yarn add @chailotl/remark-videos
bun add @chailotl/remark-videos
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2024-02-26 |
| First published | 2024-02-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Chai |
| Maintainers | chailotl |
| Keywords | remark-plugin, videos, remark, unified, plugin, mdast, markdown |

## Links

- npm: https://www.npmjs.com/package/@chailotl/remark-videos
- Repository: https://github.com/chailotl/remark-videos
- Homepage: https://github.com/chailotl/remark-videos#readme
- Issues: https://github.com/chailotl/remark-videos/issues
- npm.io page: https://npm.io/package/@chailotl/remark-videos

## Dependencies (1)

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

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.0.4 (latest) — 2024-02-26
- 1.0.2 — 2024-02-25
- 1.0.1 — 2024-02-25
- 1.0.0 — 2024-02-25

## README

# remark-videos

A **[remark][]** plugin to embed videos with `![]()`.

## Contents

*   [What is this?](#what-is-this)
*   [When should I use this?](#when-should-i-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
*   [Security](#security)
*   [License](#license)


## What is this?

This package is a [unified][] ([remark][]) plugin to embed videos with `![]()`.

## When should I use this?

This project is useful if you want to embed videos using the `![]()` syntax.

## Install

This package is [ESM only][esm]. In Node.js (version 16+), install with [npm][]:

```
npm install @chailotl/remark-videos
```

## Use

Say we have the following file `example.md`.

```md
# Image

![](image.png)

# Video

![](video.mp4)
```

...and a module `example.js`:

```js
import {remark} from 'remark'
import remarkVideos from '@chailotl/remark-videos'
import {read} from 'to-vfile'

const file = await remark()
  .use(remarkVideos)
  .process(await read('example.md'))

console.log(String(file))
```

...then running `node example.js` yields:

```html
<h1>Image</h1>
<p><img src="image.png" alt=""></p>
<h1>Video</h1>
<p><video src="video.mp4" controls=""></video></p>
```

## API

This package exports no identifiers. The default export is [`remarkVideos`][api-remark-videos].

#### `unified().use(remarkVideos)`

Embeds video links using the `![](video.mp4)` syntax

###### Parameters

There are no parameters.

###### Returns

Transform ([`Transformer`][unified-transformer]).

## Security

Use of `remark-videos` does not involve **[rehype][]** (**[hast][]**) or user
content so there are no openings for [cross-site scripting (XSS)][wiki-xss]
attacks.

## License

[MIT][license] © Chai

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[license]: license

[hast]: https://github.com/syntax-tree/hast

[rehype]: https://github.com/rehypejs/rehype

[remark]: https://github.com/remarkjs/remark

[unified]: https://github.com/unifiedjs/unified

[unified-transformer]: https://github.com/unifiedjs/unified#transformer

[wiki-xss]: https://en.wikipedia.org/wiki/Cross-site_scripting

[api-remark-unlink]: #unifieduseremarkvideos

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