{"name":"@textlint/markdown-to-ast","version":"14.7.2","author":"azu","license":"MIT","_id":"@textlint/markdown-to-ast@14.7.2","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":"e278bb6ae55c02809a9f1fab42b6544747cbd75c","tarball":"http://registry-npm.ywwl.com/@textlint/markdown-to-ast/download/@textlint/markdown-to-ast-14.7.2.tgz","fileCount":30,"integrity":"sha512-gfOQaBFoFVTj/9rzhEjnJonWZwWjM1RLmaO4J7GHIOFBAo/qr/EJRO3QijQWaAJFoH8xd/3cpUCEzpRwhwkeoA==","signatures":[{"sig":"MEQCIDJymzl/JnNKwoYrGRecN0+hp58W9Vxs1BLeN99gIE/pAiAb0THY7LykqSQV6uT46rOuq21lAZY/P8pcDb4TB7ek3A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35386,"size":8754,"noattachment":false,"key":"/@textlint/markdown-to-ast/-/@textlint/markdown-to-ast-14.7.2.tgz"},"main":"lib/src/index.js","type":"commonjs","types":"lib/src/index.d.ts","module":"module/src/index.js","gitHead":"cd4c044fe73efd049a70b69b61166c4b491cac9f","scripts":{"test":"mocha","build":"tsc -b && tsc -b tsconfig.module.json","clean":"rimraf lib/ module/","watch":"tsc -b --watch","prepack":"npm run --if-present build","updateSnapshot":"npm run build && node tools/update-fixtures.js"},"_npmUser":{"name":"textlint-user","email":"azuciao+textlint@gmail.com"},"repository":{"url":"https://github.com/textlint/textlint.git","type":"git"},"_npmVersion":"lerna/8.2.2/node@v18.20.8+x64 (linux)","description":"Parse Markdown to AST with location info.","directories":{"test":"test/"},"_nodeVersion":"18.20.8","dependencies":{"debug":"^4.4.0","unified":"^9.2.2","remark-gfm":"^1.0.0","neotraverse":"^0.6.15","remark-parse":"^9.0.0","remark-footnotes":"^3.0.0","remark-frontmatter":"^3.0.0","@textlint/ast-node-types":"^14.7.2","mdast-util-gfm-autolink-literal":"^0.1.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^10.8.1","mkdirp":"^1.0.4","rimraf":"^6.0.1","ts-node":"^10.9.2","typescript":"~5.3.3","@types/node":"^18.19.9","@types/mocha":"^9.1.1","@textlint/ast-tester":"^14.7.2"},"_npmOperationalInternal":{"tmp":"tmp/markdown-to-ast_14.7.2_1747750863822_0.6091950218425868","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":1747750864015,"_cnpm_publish_time":1747750864015,"dist-tags":{"beta":"12.0.0-beta.3","canary":"6.1.0-alpha.0f2fd6f9","latest":"15.8.0","next":"13.4.2-next.0"}}