nlcst-to-string
nlcst utility to transform a tree to a string
Last updated 6 years ago by wooorm .
MIT · Repository · Bugs · Original npm
$ cnpm install nlcst-to-string 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.0.4                                ...           latest (6 years ago)

3 Versions

  • 3.1.0                                ...           4 years ago
  • 0.1.5                                ...           11 years ago
  • 2.0.4                                ...           6 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (9)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org