elementar
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

elementar

Elementar is a content-oriented HTML simplifier.

Usage

import { fromHtml } from 'elementar';
 
const elementar = fromHtml('<p><strong>Here</strong> is the <i>answer</i>!<span></span></p>');
console.log(elementar.html()) // <p>Here is the answer!</p>
console.log(elementar.xml()) // <p><text>Here is the answer!</text></p>
console.log(elementar.text()) // Here is the answer!
 

API

fromHtml(html: string, options?: ElementarOptions): Elementar

See options.

Elementar

.html(): string

Returns the processed html.

.xml(): string

Returns the processed html as xml.

.text(): string

Returns the text from html.

/elementar/

    Package Sidebar

    Install

    npm i elementar

    Weekly Downloads

    1

    Version

    0.1.0

    License

    ISC

    Last publish

    Collaborators

    • mitica