$ cnpm install nlcst-to-string
nlcst utility to serialize a node.
npm:
npm install nlcst-to-string
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'
toString(node[, separator])Stringify the given nlcst node (or list of nodes).
node (Node or Array.<Node>)separator (string, default: '') — Value to delimit each itemstring.
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.
Copyright 2013 - present © cnpmjs.org