{"name":"@textlint/markdown-to-ast","version":"15.7.1","author":{"name":"azu"},"license":"MIT","_id":"@textlint/markdown-to-ast@15.7.1","maintainers":[{"name":"azu","email":"azuciao@gmail.com"},{"name":"textlint-user","email":"azuciao+textlint@gmail.com"}],"homepage":"https://github.com/textlint/textlint/tree/master/packages/@textlint/markdown-to-ast/","bugs":{"url":"https://github.com/textlint/textlint/issues"},"dist":{"shasum":"c35b024f4ebbc15051150ea30ea867ee14115af1","tarball":"http://registry-npm.ywwl.com/@textlint/markdown-to-ast/download/@textlint/markdown-to-ast-15.7.1.tgz","fileCount":18,"integrity":"sha512-9DLSah7g6mYNHvO6pssLdFvFPAl3HHyEIm4RE5of/1QN9FXJXDgdOcVV3YpQmbYT/YntuIvOQiqOndCSPWTW2A==","signatures":[{"sig":"MEQCIBIoJrHTRvtscHEXlnh8fPXH51CAebl0unPDAG+VWzq7AiBaaZabjBCf7FTTEorGPb0JHHHy8TssR03wtefaEGvF0A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@textlint%2fmarkdown-to-ast@15.7.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":47343,"size":13416,"noattachment":false,"key":"/@textlint/markdown-to-ast/-/@textlint/markdown-to-ast-15.7.1.tgz"},"main":"lib/src/index.js","type":"commonjs","types":"lib/src/index.d.ts","gitHead":"91ffc5947325f0a9d0500b889550a1b4d232f5f1","scripts":{"test":"vitest run","build":"tsc -b","clean":"rimraf lib/","watch":"tsc -b --watch","prepack":"npm run --if-present build","test:watch":"vitest watch","updateSnapshot":"npm run build && node tools/update-fixtures.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1ba57113-456b-4b41-855c-513bf0faadfc"}},"repository":{"url":"git+https://github.com/textlint/textlint.git","type":"git"},"_npmVersion":"lerna/4.11.5/node@v22.22.2+x64 (linux)","description":"Parse Markdown to AST with location info.","directories":{"test":"test/"},"_nodeVersion":"22.22.2","dependencies":{"debug":"^4.4.3","unified":"^9.2.2","remark-gfm":"^1.0.0","neotraverse":"^0.6.18","remark-parse":"^9.0.0","remark-footnotes":"^3.0.0","structured-source":"^4.0.0","remark-frontmatter":"^3.0.0","@textlint/ast-node-types":"15.7.1","mdast-util-gfm-autolink-literal":"^0.1.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.1.3","vitest":"^3.2.4","typescript":"~5.8.3","@types/node":"^24.12.4","@types/debug":"^4.1.13","@types/unist":"^3.0.3","@textlint/ast-tester":"15.7.1"},"_npmOperationalInternal":{"tmp":"tmp/markdown-to-ast_15.7.1_1779066608262_0.42443012694541093","host":"s3://npm-registry-packages-npm-production"},"readme":"# @textlint/markdown-to-ast\n\nParse Markdown to AST with location info.\n\nThis library is not parser itself, it dependent on [wooorm/remark](https://github.com/wooorm/remark).\n\n> Markdown -> remark -> markdown-to-ast -> `TxtNode`s\n\nThe AST consists of `TxtNode`s.\nA `TxtNode` of the AST has following properties:\n\n- `loc` - Nodes have line and column-based location info.\n- `range` - Nodes have an index-based location range (array).\n- `raw` - Node have a `raw` text.\n- `value` - Node have a `value` of text.\n\nThe interface are defined in [textlint/txtnode.md](https://github.com/textlint/textlint/blob/master/docs/txtnode.md \"textlint/txtnode.md at master · textlint/textlint\")\n\nThis library is a part of [textlint/textlint](https://github.com/textlint/textlint \"textlint/textlint\").\n\n**If you need to markdown parser, please use [wooorm/remark](https://github.com/wooorm/remark) directly.**\n\n## DEMO\n\n- [textlint AST explorer](https://textlint.org/astexplorer/ \"textlint AST explorer\")\n\n## Installation\n\n```\nnpm install @textlint/markdown-to-ast\n```\n\n## Usage\n\n```sh\nvar parse = require(\"@textlint/markdown-to-ast\").parse;\nvar markdown = \"It's a *text*\";\nvar AST = parse(markdown);\n/*\n{\n    \"type\": \"Document\",\n    \"children\": [\n        {\n            \"type\": \"Paragraph\",\n            \"children\": [\n                {\n                    \"type\": \"Str\",\n                    \"value\": \"It's a \",\n                    \"loc\": {\n                        \"start\": {\n                            \"line\": 1,\n                            \"column\": 0\n                        },\n                        \"end\": {\n                            \"line\": 1,\n                            \"column\": 7\n                        }\n                    },\n                    \"range\": [\n                        0,\n                        7\n                    ],\n                    \"raw\": \"It's a \"\n                },\n                {\n                    \"type\": \"Emphasis\",\n                    \"children\": [\n                        {\n                            \"type\": \"Str\",\n                            \"value\": \"text\",\n                            \"loc\": {\n                                \"start\": {\n                                    \"line\": 1,\n                                    \"column\": 8\n                                },\n                                \"end\": {\n                                    \"line\": 1,\n                                    \"column\": 12\n                                }\n                            },\n                            \"range\": [\n                                8,\n                                12\n                            ],\n                            \"raw\": \"text\"\n                        }\n                    ],\n                    \"loc\": {\n                        \"start\": {\n                            \"line\": 1,\n                            \"column\": 7\n                        },\n                        \"end\": {\n                            \"line\": 1,\n                            \"column\": 13\n                        }\n                    },\n                    \"range\": [\n                        7,\n                        13\n                    ],\n                    \"raw\": \"*text*\"\n                }\n            ],\n            \"loc\": {\n                \"start\": {\n                    \"line\": 1,\n                    \"column\": 0\n                },\n                \"end\": {\n                    \"line\": 1,\n                    \"column\": 13\n                }\n            },\n            \"range\": [\n                0,\n                13\n            ],\n            \"raw\": \"It's a *text*\"\n        }\n    ],\n    \"loc\": {\n        \"start\": {\n            \"line\": 1,\n            \"column\": 0\n        },\n        \"end\": {\n            \"line\": 1,\n            \"column\": 13\n        }\n    },\n    \"range\": [\n        0,\n        13\n    ],\n    \"raw\": \"It's a *text*\"\n}\n*/\n```\n\nIf you want to know real use-case, please see [textlint/textlint](https://github.com/textlint/textlint \"textlint/textlint\").\n\n## Tests\n\n```\nnpm test\n```\n\n### Create fixtures\n\nSee [tools/](tools/) directory.\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## License\n\nMIT\n","publish_time":1779066608393,"_cnpm_publish_time":1779066608393,"dist-tags":{"beta":"12.0.0-beta.3","canary":"6.1.0-alpha.0f2fd6f9","latest":"15.8.0","next":"13.4.2-next.0"}}