# @mattnick/editorjsparser

> EditorJS Parser is a small tool used to format blocks created from Editor.js

Latest version **1.0.5** (published 2020-11-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install @mattnick/editorjsparser
pnpm add @mattnick/editorjsparser
yarn add @mattnick/editorjsparser
bun add @mattnick/editorjsparser
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2020-11-11 |
| First published | 2020-10-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | M. Nick |
| Maintainers | mattnick89 |
| Keywords | Editor-js, EditorJS, Parsing, Blocks, Parser |

## Links

- npm: https://www.npmjs.com/package/@mattnick/editorjsparser
- Repository: https://github.com/mattnick89/editorjsparser
- Homepage: https://github.com/mattnick89/editorjsparser#readme
- Issues: https://github.com/mattnick89/editorjsparser/issues
- npm.io page: https://npm.io/package/@mattnick/editorjsparser

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2020-11-11
- 1.0.4 — 2020-11-10
- 1.0.3 — 2020-11-10
- 1.0.2 — 2020-11-10
- 1.0.1 — 2020-11-03
- 1.0.0 — 2020-10-28

## README

# EditorJS Parser

EditorJS Parser is a small tool used to format blocks created from Editor.js

## Installation

Use the package manager npm

```bash
npm install @mattnick/editorjsparser
```

## Usage

```javascript
const EditorJsParser = require('@mattnick/editorjsparser');
const parser = new EditorJsParser();

var blocks = [{
    type: "paragraph",
    data: {
        "text": "hello world"
    }
}];

blocks.forEach((row)=>{
    var formatted_block = parser.parse(row,"my-custom-class");
    console.log(formatted_block);
})

// formatted_block
/*

    {

        is_empty: false,
        text: "hello world",
        html: '<p class="my-custom-class">hello world</p>'

    }

*/


```

## Available Types for Parsing

- paragraph
- header
- list
- image
- embed
- quote
- delimiter
- poll

If a block does not match one of these types then it will pass straight through untouched.



## License
[MIT](https://choosealicense.com/licenses/mit/)

---
_Source: https://npm.io/package/@mattnick/editorjsparser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
