npm.io
0.0.4 • Published 5 years ago

editorjs-to-portabletext

Licence
MIT
Version
0.0.4
Deps
3
Size
267 kB
Vulns
7
Weekly
0
Stars
1

EditorJS to Portable Text

This library can be used to convert between a Editor.js block structure and a Sanity Portable Text structure.

From EditorJS to Sanity

import { EditorJSConverter } from 'editorjs-to-portabletext';
const converter = new EditorJSConverter();
const portableText = converter.convert(editorJsContent);

From Sanity to EditorJS

import { PortableTextConverter } from 'editorjs-to-portabletext';
const converter = new PortableTextConverter();
const editorJsContent = converter.convert(portableText);