Add deno, browsers to install

This commit is contained in:
Titus Wormer 2021-10-24 09:26:07 +02:00
parent db8f6428ae
commit f392cf580b
No known key found for this signature in database
GPG key ID: E6E581152ED04E2E

View file

@ -53,15 +53,27 @@ and static site generators.
## Install
This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c):
Node 12+ is needed to use it and it must be `import`ed instead of `require`d.
[npm][]:
This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
In Node.js (12.20+, 14.14+, 16.0+), install with [npm][]:
```sh
npm install remark-directive
```
In Deno with [Skypack][]:
```js
import remarkDirective from 'https://cdn.skypack.dev/remark-directive@2?dts'
```
In browsers with [Skypack][]:
```html
<script type="module">
import remarkDirective from 'https://cdn.skypack.dev/remark-directive@2?min'
</script>
```
## Use
Say we have the following file, `example.md`:
@ -329,6 +341,8 @@ abide by its terms.
[npm]: https://docs.npmjs.com/cli/install
[skypack]: https://www.skypack.dev
[health]: https://github.com/remarkjs/.github
[contributing]: https://github.com/remarkjs/.github/blob/HEAD/contributing.md