{"library":"nlcst-to-string","title":"NLCST to String Converter","description":"nlcst-to-string is a utility designed to serialize NLCST (Natural Language Concrete Syntax Tree) nodes into their plain-text string representation. It is part of the unified ecosystem, focusing specifically on text content extraction from linguistic ASTs. The current stable version is 4.0.0. Releases follow the unified collective's compatibility policy, typically dropping support for unmaintained Node.js versions with new major releases (e.g., v4 requires Node.js 16+). Key differentiators include its tight integration with the NLCST specification, its minimal API (a single `toString` function), and its robust handling of various NLCST node types by prioritizing plain-text fields or recursively serializing children. This package is an ESM-only module since version 3.0.0 and ships with full TypeScript type definitions.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install nlcst-to-string"],"cli":null},"imports":["import { toString } from 'nlcst-to-string'","import { toString } from 'https://esm.sh/nlcst-to-string@4?bundle'","import type { Node } from 'nlcst'\nimport { toString } from 'nlcst-to-string'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { toString } from 'nlcst-to-string';\nimport type { Parent, Text } from 'nlcst';\n\nconst exampleNode: Parent = {\n  type: 'SentenceNode',\n  children: [\n    { type: 'WordNode', children: [{ type: 'TextNode', value: 'Hello' }] },\n    { type: 'PunctuationNode', value: ',' },\n    { type: 'SpaceNode', value: ' ' },\n    { type: 'WordNode', children: [{ type: 'TextNode', value: 'world' }] },\n    { type: 'PunctuationNode', value: '!' }\n  ]\n};\n\nconst complexWordNode: Parent = {\n  type: 'WordNode',\n  children: [\n    { type: 'TextNode', value: 'AT' },\n    { type: 'SymbolNode', value: '&' },\n    { type: 'TextNode', value: 'T' }\n  ]\n};\n\nconsole.log(toString(exampleNode));\nconsole.log(toString(complexWordNode));\n// Expected output:\n// Hello, world!\n// AT&T","lang":"typescript","description":"This quickstart demonstrates how to import and use the `toString` function to convert an NLCST node or a list of nodes into a plain-text string, showing its handling of different node types.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}