This library provides a set of utility functions to convert draftJs content in a Node JS environment without browser dependencies.
Implementation was extracted from sstur/draft-js-utils and modified
Use npm to install the package. Alternatively you can find the latest downloads on the release page.
$ npm install draftjs-node-utils
1. Convert HTML to DraftJS
import draftJs from 'draft-js';
import { htmlToDraftJs } from "draftjs-node-utils";
const contentState = htmlToDraftJs(html);
const draftJsRaw = draftJs.convertToRaw(contentState);
Please make sure to read the issue reporting checklist before opening an issue. Issues not conforming to the guidelines may be closed immediately.
Detailed changes for each release are documented in the release notes.
Contributions, issues and feature requests are welcome. Feel free to check issues page if you want to contribute. Please make sure to read the contributing guide before making a pull request.
Copyright © 2022 Chathura Buddhika (chathurabuddi)
This project is ISC licensed.