{"name":"@textlint/markdown-to-ast","version":"15.2.0","author":"azu","license":"MIT","_id":"@textlint/markdown-to-ast@15.2.0","maintainers":[{"name":"azu","email":"azuciao@gmail.com"},{"name":"0x6b","email":"npm_mytidhfqd7ncqnr73yfj@warpnine.io"},{"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":"e1147ff94f20f03f6711ffd7825b2b3325c37ff3","tarball":"http://registry-npm.ywwl.com/@textlint/markdown-to-ast/download/@textlint/markdown-to-ast-15.2.0.tgz","fileCount":18,"integrity":"sha512-vwZaZhw0bUPP244d2RWXaSdIWPoo0fuGfy+fagkVsP559eRWV8bzm/79KraQgNGL6o2Vedy08qFt8iNvNIJBdw==","signatures":[{"sig":"MEUCIQD90zL9PYA7d5jGoeYHjSpV3nhMBuZ51xA9rIQKHCh14AIgfsyJ0wveyYmHm8au4NVx1o2ta1Oj2IShjFHaGpfxfjw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46298,"size":13156,"noattachment":false,"key":"/@textlint/markdown-to-ast/-/@textlint/markdown-to-ast-15.2.0.tgz"},"main":"lib/src/index.js","type":"commonjs","types":"lib/src/index.d.ts","gitHead":"fa214af595129a5d0af056c0b7e2e6900faa3e7f","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":"textlint-user","actor":{"name":"textlint-user","type":"user","email":"azuciao+textlint@gmail.com"},"email":"azuciao+textlint@gmail.com"},"repository":{"url":"https://github.com/textlint/textlint.git","type":"git"},"_npmVersion":"lerna/8.2.2/node@v22.16.0+x64 (linux)","description":"Parse Markdown to AST with location info.","directories":{"test":"test/"},"_nodeVersion":"22.16.0","dependencies":{"debug":"^4.4.1","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.2.0","mdast-util-gfm-autolink-literal":"^0.1.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mkdirp":"^1.0.4","rimraf":"^6.0.1","vitest":"^3.2.4","typescript":"~5.8.3","@types/node":"^18.19.113","@types/debug":"^4.1.12","@types/unist":"^3.0.3","@textlint/ast-tester":"15.2.0"},"_npmOperationalInternal":{"tmp":"tmp/markdown-to-ast_15.2.0_1751761855276_0.0874198301059157","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":1751761855477,"_cnpm_publish_time":1751761855477,"dist-tags":{"beta":"12.0.0-beta.3","canary":"6.1.0-alpha.0f2fd6f9","latest":"15.8.0","next":"13.4.2-next.0"}}