nlcst-to-string
nlcst utility to stringify a node.
Install
npm:
npm install nlcst-to-string
Usage
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(NodeorArray.<Node>)separator(string, optional, 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, organisation, or community you agree to abide by its terms.