{"name":"ast-plugin","version":"0.0.3","description":"The simplest abstract syntax tree walker.","main":"lib/index.js","scripts":{"test":"jest","coveralls":"cat ./coverage/lcov.info | coveralls","build":"rimraf ./lib && babel src -d lib"},"repository":{"type":"git","url":"git+https://github.com/hustcc/ast-plugin.git"},"keywords":["ast","plugin","ast-plugin"],"author":{"name":"hustcc"},"license":"MIT","bugs":{"url":"https://github.com/hustcc/ast-plugin/issues"},"homepage":"https://github.com/hustcc/ast-plugin#readme","devDependencies":{"@babel/cli":"^7.1.5","@babel/core":"^7.1.5","@babel/plugin-proposal-class-properties":"^7.1.0","@babel/plugin-transform-spread":"^7.0.0","@babel/preset-env":"^7.1.5","babel-core":"^7.0.0-bridge.0","babel-jest":"^23.6.0","coveralls":"^3.0.2","jest":"^23.6.0","remark-parse":"^6.0.2","rimraf":"^2.6.2","unified":"^7.0.1"},"jest":{"collectCoverage":true,"testEnvironment":"node","testRegex":"(/__tests__/.*\\.(test|spec))\\.jsx?$","collectCoverageFrom":["src/**/*.{js,jsx}"]},"gitHead":"2f30b64d588a2064d5c06e95f5659d8b7f3ac510","_id":"ast-plugin@0.0.3","_npmVersion":"6.4.1","_nodeVersion":"8.7.0","_npmUser":{"name":"atool","email":"vip@hust.edu.cn"},"dist":{"integrity":"sha512-JJrLe69UbXHyaOeAzMd29Bd7qUZ9RNIWrM6yHgDPV2hlofQXtNIppFTy9juO9adlP6A7SdfXFjSNql+36FfNSg==","shasum":"0543874bd2aba308746be362b077f776fd9ff99e","tarball":"http://registry-npm.ywwl.com/ast-plugin/download/ast-plugin-0.0.3.tgz","fileCount":7,"unpackedSize":6714,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFRSCCRA9TVsSAnZWagAAWuQP/A05HBM0+dnL73sEV0GJ\nGN0J6tcpZ8kXCQhFzKQyTPEoTP2scItt3usBdQUKUPHapSolAg8i4j29vUMT\nxkLX3x28iBgwywiW9TIzQksMqXU49NZ1QBKatdHrwfj4mMNQBK8VP7UFHWAP\n0RjJuxfrzVUJ6w6+mkwfvEVrukS0Jg5Zjm1F0vt7p4B4di3Ok4SXrOMe9QUE\nDSw6bLkGkTXiACXix2MDnxRxlSraK0kSPitz3OuMNf8FQhAmv9WV4oqXr92P\n8wI1OkrzkCwdXZnKgsXh9Njej78xWqWVSWn9eEXpqVzDLAlsVyf+MhcrijfL\nsE3lAVD9B3IVRzzTLlIuCMEkREF8QTYsv7WsFSST+Vo12OUqBv834/ProWRL\nbfZsLIeq33uruQLmpeDvifZDJKfI0XEaQqKOiG2UIVq7LJXExaGNi+dJqQmJ\nPK74+Co/RaW44KMAQwtqv2cFe5VegDydOkWLanWaznSp81d/Six6G8bmmXI1\nluqXpo7/0ZQPK35M9mJdBi7j5sknEOvj4NhtdPeEX5lbPptY01bkwatkQPsM\nUpNbxT8CJftEAzBYwW/J3xocj89sW1MKZjzdR3b2pqBe0Ym8vt5Nc6XCFuV7\nSmfhbtQENWQVlBYsMnRSHWw6LGMAAoP7Nam5MacRtiBB7JTN/MSiTOwfRE2S\nu7jO\r\n=P+v+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHVcqN2Tt1U6eoaBHA37xEpOhIgPoLBud9XOWZplDyE1AiBuc7Oya2zaZO+kuWXykhc/JEkSGxi0Tzu/4KIAeN8C5A=="}],"size":2549,"noattachment":false,"key":"/ast-plugin/-/ast-plugin-0.0.3.tgz"},"maintainers":[{"name":"atool","email":"vip@hust.edu.cn"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ast-plugin_0.0.3_1544885377890_0.20960801925417938"},"_hasShrinkwrap":false,"readme":"# ast-plugin\n\n> The simplest abstract syntax tree walker.\n\n\n## Install\n\n> npm i --save ast-plugin\n\n\n\n## Usage\n\n - Traverse Ast plugins\n\n```js\nimport { Ast, Plugin } from 'ast-plugin';\n\nnew Ast(ast).traverse([\n  new TestPlugin(cfg),\n  // ...\n]);\n```\n\n - Write an ast plugin\n\n```js\nimport { Ast, Plugin } from 'ast-plugin';\n\nclass TestPlugin extends Plugin {\n\n  pre = () => {};\n\n  visitor = () => {\n    return {\n      // process node with type = 'text'\n      text: ast => {\n        console.log(ast.node);\n        ast.segment();\n      },\n    };\n  };\n\n  post = () => {};\n}\n```\n\n\n\n## Used by\n\n - [lint-md](https://github.com/hustcc/lint-md): Cli tool to lint your markdown file for Chinese.\n\n\n\n\n## License\n\nMIT@[hustcc](https://github.com/hustcc).\n","publish_time":1544885378022,"_cnpm_publish_time":1544885378022,"dist-tags":{"latest":"0.0.7"}}