{"id":13717099,"url":"https://github.com/syntax-tree/nlcst-to-string","last_synced_at":"2025-12-12T04:28:15.720Z","repository":{"id":21250904,"uuid":"24566409","full_name":"syntax-tree/nlcst-to-string","owner":"syntax-tree","description":"utility to transform an nlcst tree to a string","archived":false,"fork":false,"pushed_at":"2024-04-30T12:04:51.000Z","size":136,"stargazers_count":19,"open_issues_count":0,"forks_count":5,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-07-12T03:49:03.713Z","etag":null,"topics":["nlcst","nlcst-util","serialize","string","stringify","syntax-tree","unist","util"],"latest_commit_sha":null,"homepage":"https://unifiedjs.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Alhadis/Utils","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/syntax-tree.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"unifiedjs","open_collective":"unified"}},"created_at":"2014-09-28T18:05:48.000Z","updated_at":"2024-12-29T08:00:18.000Z","dependencies_parsed_at":"2023-02-11T02:45:30.744Z","dependency_job_id":"d3d0a522-0aaf-49db-905d-8419018f2bc0","html_url":"https://github.com/syntax-tree/nlcst-to-string","commit_stats":{"total_commits":133,"total_committers":7,"mean_commits":19.0,"dds":"0.045112781954887216","last_synced_commit":"6f915c28d57119847086e1e479ae789dcef9f962"},"previous_names":["wooorm/nlcst-to-string"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/syntax-tree/nlcst-to-string","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fnlcst-to-string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fnlcst-to-string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fnlcst-to-string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fnlcst-to-string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syntax-tree","download_url":"https://codeload.github.com/syntax-tree/nlcst-to-string/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fnlcst-to-string/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264958203,"owners_count":23689012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nlcst","nlcst-util","serialize","string","stringify","syntax-tree","unist","util"],"created_at":"2024-08-03T00:01:17.910Z","updated_at":"2025-12-12T04:28:10.693Z","avatar_url":"https://github.com/syntax-tree.png","language":"JavaScript","readme":"# nlcst-to-string\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n[nlcst][] utility to serialize a node.\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`toString(value)`](#tostringvalue)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package is a utility that takes [nlcst][] nodes and gets their plain-text\nvalue.\n\n## When should I use this?\n\nThis is a small utility that is useful when you’re dealing with ASTs.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install nlcst-to-string\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {toString} from 'https://esm.sh/nlcst-to-string@4'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import {toString} from 'https://esm.sh/nlcst-to-string@4?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\n```js\nimport {toString} from 'nlcst-to-string'\n\nconsole.log(\n  toString({\n    type: 'WordNode',\n    children: [\n      {type: 'TextNode', value: 'AT'},\n      {type: 'SymbolNode', value: '\u0026'},\n      {type: 'TextNode', value: 'T'}\n    ]\n  })\n) // =\u003e 'AT\u0026T'\n```\n\n## API\n\nThis package exports the identifier [`toString`][api-to-string].\nThere is no default export.\n\n### `toString(value)`\n\nGet the text content of a node or list of nodes.\n\nPrefers the node’s plain-text fields, otherwise serializes its children, and\nif the given value is an array, serialize the nodes in it.\n\n###### Parameters\n\n* `node` ([`Array\u003cNode\u003e`][node] or `Node`)\n  — node or list of nodes to serialize\n\n###### Returns\n\nResult (`string`).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line, `nlcst-to-string@^4`,\ncompatible with Node.js 16.\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for\nways to get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n\u003c!-- Definitions --\u003e\n\n[build-badge]: https://github.com/syntax-tree/nlcst-to-string/workflows/main/badge.svg\n\n[build]: https://github.com/syntax-tree/nlcst-to-string/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/nlcst-to-string.svg\n\n[coverage]: https://codecov.io/github/syntax-tree/nlcst-to-string\n\n[downloads-badge]: https://img.shields.io/npm/dm/nlcst-to-string.svg\n\n[downloads]: https://www.npmjs.com/package/nlcst-to-string\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size\u0026query=$.size.compressedSize\u0026url=https://deno.bundlejs.com/?q=nlcst-to-string\n\n[size]: https://bundlejs.com/?q=nlcst-to-string\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/syntax-tree/unist/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[typescript]: https://www.typescriptlang.org\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/syntax-tree/.github\n\n[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md\n\n[support]: https://github.com/syntax-tree/.github/blob/main/support.md\n\n[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md\n\n[nlcst]: https://github.com/syntax-tree/nlcst\n\n[node]: https://github.com/syntax-tree/nlcst#nodes\n\n[api-to-string]: #tostringvalue\n","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":["nlcst utilities"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntax-tree%2Fnlcst-to-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyntax-tree%2Fnlcst-to-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntax-tree%2Fnlcst-to-string/lists"}