New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

slate-serializers

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slate-serializers - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

2

package.json
{
"name": "slate-serializers",
"version": "0.0.2",
"version": "0.0.3",
"description": "Serialize Slate JSON objects to HTML and vice versa. Define rules to modify the end result.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

# slate-serializers
A collection of serializers to convert Slate JSON objects to various formats and vice versa.
Serializers included so far:
- `slateToHtml`
- `htmlToSlate`
## Installation
```bash
yarn add slate-serializers
# or
npm install slate-serializers
```
Example usage:
```ts
import { slateToHtml, htmlToSlate } from 'slate-serializers'
const slate = [
{
children: [
{
text: 'Heading 1',
},
],
type: 'h1',
},
{
children: [
{
text: 'Paragraph 1',
},
],
type: 'p',
},
]
const serializedToHtml = slateToHtml(slate)
// output
// <h1>Heading 1</h1><p>Paragraph 1</p>
// ...and convert back to Slate
const serializedToSlate = htmlToSlate(serializedToHtml)
```
## Development

@@ -4,0 +51,0 @@

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