orgast-util-to-string
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

orgast-util-to-string

orgast (uniorg) utility to get the plain text content of a node.

Install

npm install orgast-util-to-string

Use

import { unified } from 'unified';
import uniorgParse from 'uniorg-parse';
import { toString } from 'orgast-util-to-string';

const tree = unified()
  .use(uniorgParse)
  .parse('Some /emphasis/, *importance*, and ~code~.');

console.log(toString(tree)); //=> 'Some emphasis, importance, and code.'

API

toString(node[, options])

Get the text content of a node or list of nodes.

The algorithm checks value of node. If no value is found, the algorithm checks the children of node and joins them (without spaces or newlines).

This is not an org-mode to plain-text library.

License

GNU General Public License v3.0 or later

/orgast-util-to-string/

    Package Sidebar

    Install

    npm i orgast-util-to-string

    Weekly Downloads

    56

    Version

    1.0.1

    License

    GPL-3.0-or-later

    Unpacked Size

    38.8 kB

    Total Files

    6

    Last publish

    Collaborators

    • rasendubi
    • thomasfkjorna