nlcst-to-string
nlcst utility to transform a tree to a string
Last updated 4 months ago by wooorm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ 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 (4 months ago)

16 Versions

  • 2.0.4                                ...           4 months ago
  • 2.0.3                                ...           a year ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           4 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.1.5                                ...           5 years ago
  • 0.1.4                                ...           6 years ago
  • 0.1.3                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (2)
Downloads
Today 87
This Week 458
This Month 288
Last Day 114
Last Week 490
Last Month 2,243
Dependencies (0)
None
Dev Dependencies (9)
Dependents (114)

Copyright 2014 - 2016 © taobao.org |