# enml-js

> Evernote's ENML library in Javascript

Latest version **0.1.3** (published 2014-02-23) · 0 weekly downloads

## Install

```sh
npm install enml-js
pnpm add enml-js
yarn add enml-js
bun add enml-js
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2014-02-23 |
| First published | 2013-01-25 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 101 |
| Maintainers | wanasit |

## Links

- npm: https://www.npmjs.com/package/enml-js
- Repository: https://github.com/berryboy/enml-js
- Issues: https://github.com/berryboy/enml-js/issues
- npm.io page: https://npm.io/package/enml-js

## Recent versions

- 0.1.3 (latest) — 2014-02-23
- 0.0.3 — 2014-01-25
- 0.0.2 — 2013-05-06
- 0.0.1 — 2013-01-25

## README

enml-js
===========

[Evernote's ENML](http://dev.evernote.com/documentation/cloud/chapters/ENML.php) library in Javascript.

## INSTALLATION

### Node.js

    npm install enml-js

### Browser

    <script src="https://raw.github.com/berryboy/enml-js/master/enml.js"></script>
    <script src="https://raw.github.com/berryboy/enml-js/master/lib/xml-writer.js"></script>
    <script src="https://raw.github.com/berryboy/enml-js/master/lib/xml-parser.js"></script>

Functions
============

**enml.ENMLOfPlainText**(String) - Encode plain text in ENML format.

    > enml.ENMLOfPlainText("Hello  World!!")
    '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">\n<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hello  World!!</div>\n</en-note>'

    > enml.ENMLOfPlainText("Hello\nWorld!!")
    '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">\n<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hello</div>\n<div>World!!</div>\n</en-note>'

**enml.PlainTextOfENML**(String) - Translate ENML content into normal plain text.

        > enml.PlainTextOfENML('<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">\n<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hello</div>\n<div>World!!</div>\n</en-note>')
        ' Hello World!! '

**enml.HTMLOfENML**(String, [ Map <String, {url: String, title: String}> ]) - Translate ENML to HTML for viewing in browsers. To show resources you have to provide a map of resources' hash and their src url and title.

    > enml.HTMLOfENML('<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">\n<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hello</div>\n<div>World!!</div>\n</en-note>')
    '<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hello</div>\n<div>World!!</div>\n</body></html>'


**enml.TodosOfENML**(String) - Extract data of all TODO(s) in ENML text.

    > enml.TodosOfENML('<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><en-todo/>Task1<div><en-todo checked="true"/>Task2<br/></div><div><en-todo/>With <b>Bold</b> <i>Italic</i> and <u>Underline</u><br/></div><div><u><en-todo/></u>With <font color="#FF2600">Color</font><br/></div></en-note>')
    [ { text: 'Task1', checked: false },
      { text: 'Task2', checked: true },
      { text: 'With Bold Italic and Underline',
        checked: false },
      { text: 'With Color', checked: false } ]

**enml.CheckTodoInENML**(String, Int, Bool) - Rewrite ENML content by changing check/uncheck value of the TODO in given position.

          > enml.CheckTodoInENML('<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><en-todo/>Task1<div><en-todo checked="true"/>Task2<br/></div><div><en-todo/>With <b>Bold</b> <i>Italic</i> and <u>Underline</u><br/></div><div><u><en-todo/></u>With <font color="#FF2600">Color</font><br/></div></en-note>',
          0, true )
          <en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><en-todo checked="true"/>Task1<div><en-todo checked="true"/>Task2<br/></div><div><en-todo/>With <b>Bold</b> <i>Italic</i> and <u>Underline</u><br/></div><div><u><en-todo/></u>With <font color="#FF2600">Color</font><br/></div></en-note>'

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