unified

Project: syntax-tree/nlcst-to-string

Package: nlcst-to-string@2.0.4

  1. Dependencies: 0·Dependents: 91
  2. nlcst utility to transform a tree to a string
  1. util 107
  2. utility 105
  3. unist 97
  4. stringify 17
  5. nlcst 13
  6. nlcst-util 8
  7. serialize 8
  8. string 4

nlcst-to-string

Build Coverage Downloads Size Sponsors Backers Chat

nlcst utility to serialize a node.

Install

npm:

npm install nlcst-to-string

Use

var toString = require('nlcst-to-string')

console.log(
  toString({
    type: 'WordNode',
    children: [
      {type: 'TextNode', value: 'AT'},
      {type: 'PunctuationNode', value: '&'},
      {type: 'TextNode', value: 'T'}
    ]
  })
) // => 'AT&T'

API

toString(node[, separator])

Stringify the given nlcst node (or list of nodes).

Parameters
Returns

string.

Contribute

See contributing.md in syntax-tree/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer