Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

nlcst-to-string

2.0.4 • Public • Published

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
  • node (Node or Array.<Node>)
  • separator (string, default: '') — Value to delimit each item
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

Install

npm i nlcst-to-string

DownloadsWeekly Downloads

209,229

Version

2.0.4

License

MIT

Unpacked Size

6.39 kB

Total Files

4

Last publish

Collaborators

  • avatar
  • avatar