{"name":"vue-parser","version":"0.0.2","description":"Get contents from tags in .vue files (using AST tree).","author":{"name":"David Graham","email":"prograhammer@gmail.com"},"license":"MIT","homepage":"https://github.com/prograhammer/vue-parser","private":false,"main":"./lib/index.js","typings":"./lib/index.d.ts","repository":{"type":"git","url":"git+https://github.com/prograhammer/vue-parser.git"},"keywords":["vue","parser","ast","sfc"],"bugs":{"url":"https://github.com/prograhammer/vue-parser/issues"},"scripts":{"clean":"rimraf lib","compile":"tsc","build":"npm run clean && npm run compile"},"devDependencies":{"rimraf":"^2.4.4","tslint":"^5.0.0","typescript":"^2.0.3"},"engines":{"node":">= 4.0.0","npm":">= 3.0.0"},"dependencies":{"parse5":"^3.0.3"},"gitHead":"b6c432192c1602413890b3c61f6a2f9e8f9497d4","_id":"vue-parser@0.0.2","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"prograhammer","email":"prograhammer@gmail.com"},"dist":{"integrity":"sha512-zGsNUkOiiSgsjLJnFdfdrV0P4NasbKsLbmGUr4kTZqQSSw8l3uysXZ8/hNheBQlpGpbFcYvTjx/FnXSCqdQaqg==","shasum":"8b55dab01c8ff04cfbb3296a2eccd52233fc42a1","tarball":"http://registry-npm.ywwl.com/vue-parser/download/vue-parser-0.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHV6EkRbZvBHhErBEraFqZUMfcKYKEMtzqk/toxIpB4wIgAf1HuQK/b1g5/KTQ1ZVDLvib2xK7KmZMdOUQzjjybnc="}],"size":1367,"noattachment":false,"key":"/vue-parser/-/vue-parser-0.0.2.tgz"},"maintainers":[{"name":"prograhammer","email":"prograhammer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-parser-0.0.2.tgz_1511084467686_0.9317738094832748"},"directories":{},"readme":"# Vue Parser\n\n![Important](https://travis-ci.org/prograhammer/vue-parser.svg?branch=master \"Travis CI badge\")\n\nA simple way to parse a `.vue` file's contents (single file component) to get specific content from a\n tag like a template, script, or style tag. \nThe returned content can be padded repeatedly with a specific string so that line numbers are retained\n (ie. good for reporting linting errors). You can also get the full [parse5](https://github.com/inikulin/parse5/blob/master/lib/index.d.ts#L193) \n node/element which includes the location info of where the tag content is located. \n\n# Basic Usage\n\n```javascript\nimport vueParser from 'vue-parser'\n\nconst vueFileContents = `\n<template lang=\"pug\">\n.hello\n  h1 {{ msg }}\n</template>\n\n<script lang=\"js\">\nexport default {\n  name: 'Hello',\n\n  data () {\n    return {\n      msg: 'Hello World!'\n    }\n  }\n\n}\n</script>\n\n<style>\nh1 {\n  font-weight: normal;\n}\n</style>\n`\n\nconst myScriptContents = vueParser.parse(vueFileContents, 'script', { lang: ['js', 'jsx'] })\n\nconsole.log(myScriptContents)\n\n```\n\nThe console output would like like this \n(notice default padding string is `// ` since comments are typically ignored by linters/compilers/etc.):  \n\n```text\n// \n// \n// \n// \n// \n// \nexport default {\n  name: 'Hello',\n\n  data () {\n    return {\n      msg: 'Hello World!'\n    }\n  }\n\n}\n```\n","publish_time":1511084468597,"_cnpm_publish_time":1511084468597,"dist-tags":{"latest":"1.1.6"}}