JSPM

draftjs-node-utils

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q59361F
  • License ISC

draft-js html conversion utils for node

Package Exports

  • draftjs-node-utils
  • draftjs-node-utils/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (draftjs-node-utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

DraftJs Node Utils

ISC Licence Quality Gate Status codecov Latest Version

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

Installation & Usage

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);

Issues

Please make sure to read the issue reporting checklist before opening an issue. Issues not conforming to the guidelines may be closed immediately.

Changelog

Detailed changes for each release are documented in the release notes.

Contribution

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.

License

Copyright © 2022 Chathura Buddhika (chathurabuddi)
This project is ISC licensed.