Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rehype-stringify

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rehype-stringify - npm Package Compare versions

Comparing version 8.0.0 to 9.0.0

index.d.ts

16

index.js

@@ -1,15 +0,3 @@

'use strict'
import rehypeStringify from './lib/index.js'
var toHTML = require('hast-util-to-html')
module.exports = stringify
function stringify(config) {
var settings = Object.assign({}, config, this.data('settings'))
this.Compiler = compiler
function compiler(tree) {
return toHTML(tree, settings)
}
}
export default rehypeStringify
{
"name": "rehype-stringify",
"version": "8.0.0",
"version": "9.0.0",
"description": "rehype plugin to serialize HTML",

@@ -21,3 +21,3 @@ "license": "MIT",

"homepage": "https://github.com/rehypejs/rehype",
"repository": "https://github.com/rehypejs/rehype/tree/master/packages/rehype-stringify",
"repository": "https://github.com/rehypejs/rehype/tree/main/packages/rehype-stringify",
"bugs": "https://github.com/rehypejs/rehype/issues",

@@ -32,11 +32,26 @@ "funding": {

],
"sideEffects": false,
"type": "module",
"main": "index.js",
"types": "index.d.ts",
"files": [
"index.js",
"types/index.d.ts"
"lib/",
"index.d.ts",
"index.js"
],
"types": "types/index.d.ts",
"dependencies": {
"hast-util-to-html": "^7.1.1"
"@types/hast": "^2.0.0",
"hast-util-to-html": "^8.0.0",
"unified": "^10.0.0"
},
"xo": false
"scripts": {
"build": "rimraf \"lib/**/*.d.ts\" && tsc && type-coverage"
},
"xo": false,
"typeCoverage": {
"atLeast": 100,
"detail": true,
"strict": true,
"ignoreCatch": true
}
}

@@ -22,37 +22,52 @@ # rehype-stringify

<!--lint ignore no-html maximum-line-length-->
Support this effort and give back by sponsoring on [OpenCollective][collective]!
<!--lint ignore no-html-->
<table>
<tr valign="top">
<td width="20%" align="center">
<a href="https://vercel.com"><img src="https://avatars1.githubusercontent.com/u/14985020?s=400&v=4"></a>
<br><br>🥇
<a href="https://vercel.com">Vercel</a>
</td>
<td width="20%" align="center">
<a href="https://www.gatsbyjs.org"><img src="https://avatars1.githubusercontent.com/u/12551863?s=400&v=4"></a>
<br><br>🥇
<a href="https://www.gatsbyjs.org">Gatsby</a>
</td>
<td width="20%" align="center">
<a href="https://www.netlify.com"><img src="https://avatars1.githubusercontent.com/u/7892489?s=400&v=4"></a>
<br><br>🥇
<a href="https://www.netlify.com">Netlify</a>
</td>
<td width="20%" align="center">
<a href="https://www.holloway.com"><img src="https://avatars1.githubusercontent.com/u/35904294?s=400&v=4"></a>
<br><br>
<a href="https://www.holloway.com">Holloway</a>
</td>
<td width="20%" align="center">
<br><br><br><br>
<a href="https://opencollective.com/unified"><strong>You?</strong>
</td>
</tr>
<tr valign="middle">
<td width="20%" align="center" colspan="2">
<a href="https://www.gatsbyjs.org">Gatsby</a> 🥇<br><br>
<a href="https://www.gatsbyjs.org"><img src="https://avatars1.githubusercontent.com/u/12551863?s=256&v=4" width="128"></a>
</td>
<td width="20%" align="center" colspan="2">
<a href="https://vercel.com">Vercel</a> 🥇<br><br>
<a href="https://vercel.com"><img src="https://avatars1.githubusercontent.com/u/14985020?s=256&v=4" width="128"></a>
</td>
<td width="20%" align="center" colspan="2">
<a href="https://www.netlify.com">Netlify</a><br><br>
<!--OC has a sharper image-->
<a href="https://www.netlify.com"><img src="https://images.opencollective.com/netlify/4087de2/logo/256.png" width="128"></a>
</td>
<td width="10%" align="center">
<a href="https://www.holloway.com">Holloway</a><br><br>
<a href="https://www.holloway.com"><img src="https://avatars1.githubusercontent.com/u/35904294?s=128&v=4" width="64"></a>
</td>
<td width="10%" align="center">
<a href="https://themeisle.com">ThemeIsle</a><br><br>
<a href="https://themeisle.com"><img src="https://avatars1.githubusercontent.com/u/58979018?s=128&v=4" width="64"></a>
</td>
<td width="10%" align="center">
<a href="https://boosthub.io">Boost Hub</a><br><br>
<a href="https://boosthub.io"><img src="https://images.opencollective.com/boosthub/6318083/logo/128.png" width="64"></a>
</td>
<td width="10%" align="center">
<a href="https://expo.io">Expo</a><br><br>
<a href="https://expo.io"><img src="https://avatars1.githubusercontent.com/u/12504344?s=128&v=4" width="64"></a>
</td>
</tr>
<tr valign="middle">
<td width="100%" align="center" colspan="10">
<br>
<a href="https://opencollective.com/unified"><strong>You?</strong></a>
<br><br>
</td>
</tr>
</table>
[**Read more about the unified collective on Medium »**][announcement]
## 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][]:

@@ -67,10 +82,10 @@

```js
var unified = require('unified')
var createStream = require('unified-stream')
var parse = require('rehype-parse')
var stringify = require('rehype-stringify')
import {unified} from 'unified'
import {stream} from 'unified-stream'
import rehypeParse from 'rehype-parse'
import rehypeStringify from 'rehype-stringify'
var processor = unified()
.use(parse)
.use(stringify, {
const processor = unified()
.use(rehypeParse)
.use(rehypeStringify, {
quoteSmart: true,

@@ -82,3 +97,3 @@ closeSelfClosing: true,

process.stdin.pipe(createStream(processor)).pipe(process.stdout)
process.stdin.pipe(stream(processor)).pipe(process.stdout)
```

@@ -88,4 +103,7 @@

### `processor.use(stringify[, options])`
This package exports no identifiers.
The default export is `rehypeStringify`.
### `unified().use(rehypeStringify[, options])`
Configure `processor` to serialize [**hast**][hast] syntax trees to HTML.

@@ -125,5 +143,5 @@

[build-badge]: https://img.shields.io/travis/rehypejs/rehype.svg
[build-badge]: https://github.com/rehypejs/rehype/workflows/main/badge.svg
[build]: https://travis-ci.org/rehypejs/rehype
[build]: https://github.com/rehypejs/rehype/actions

@@ -148,13 +166,13 @@ [coverage-badge]: https://img.shields.io/codecov/c/github/rehypejs/rehype.svg

[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
[chat]: https://spectrum.chat/unified/rehype
[chat]: https://github.com/rehypejs/rehype/discussions
[health]: https://github.com/rehypejs/.github
[contributing]: https://github.com/rehypejs/.github/blob/master/contributing.md
[contributing]: https://github.com/rehypejs/.github/blob/HEAD/contributing.md
[support]: https://github.com/rehypejs/.github/blob/master/support.md
[support]: https://github.com/rehypejs/.github/blob/HEAD/support.md
[coc]: https://github.com/rehypejs/.github/blob/master/code-of-conduct.md
[coc]: https://github.com/rehypejs/.github/blob/HEAD/code-of-conduct.md

@@ -165,3 +183,3 @@ [ideas]: https://github.com/rehypejs/ideas

[license]: https://github.com/rehypejs/rehype/blob/master/license
[license]: https://github.com/rehypejs/rehype/blob/main/license

@@ -176,3 +194,3 @@ [author]: https://wooorm.com

[processor]: https://github.com/rehypejs/rehype/tree/master/packages/rehype
[processor]: https://github.com/rehypejs/rehype/tree/main/packages/rehype

@@ -185,8 +203,6 @@ [compiler]: https://github.com/unifiedjs/unified#processorcompiler

[rehype-dom-stringify]: https://github.com/rehypejs/rehype-dom/tree/master/packages/rehype-dom-stringify
[rehype-dom-stringify]: https://github.com/rehypejs/rehype-dom/tree/HEAD/packages/rehype-dom-stringify
[announcement]: https://medium.com/unifiedjs/collectively-evolving-through-crowdsourcing-22c359ea95cc
[sanitize]: https://github.com/rehypejs/rehype-sanitize
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc