{"_id":"vue-parser","_rev":"201717","name":"vue-parser","description":"Get contents from tags in .vue files (using AST tree).","dist-tags":{"latest":"1.1.6"},"maintainers":[{"name":"prograhammer","email":"prograhammer@gmail.com"}],"time":{"modified":"2021-06-03T12:33:21.000Z","created":"2017-11-16T01:58:32.322Z","1.1.6":"2018-01-10T23:38:25.424Z","1.1.5":"2017-12-23T17:04:16.934Z","1.1.4":"2017-12-23T16:54:47.559Z","1.1.3":"2017-12-15T16:07:08.848Z","1.1.0":"2017-12-14T15:54:16.304Z","1.0.1":"2017-12-01T13:55:40.652Z","1.0.0":"2017-11-28T22:45:47.298Z","0.0.3":"2017-11-19T09:48:24.871Z","0.0.2":"2017-11-19T09:41:08.597Z","0.0.1":"2017-11-16T01:58:32.322Z"},"users":{},"author":{"name":"David Graham","email":"prograhammer@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/prograhammer/vue-parser.git"},"versions":{"1.1.6":{"name":"vue-parser","version":"1.1.6","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 ","test":"npm run build && mocha -R spec ./test","build":"npm run clean && npm run compile"},"devDependencies":{"chai":"^4.1.2","mocha":"^4.0.1","rimraf":"^2.4.4","tslint":"^5.0.0","tslint-config-standard":"^7.0.0","typescript":"^2.6.2"},"engines":{"node":">= 4.0.0","npm":">= 3.0.0"},"dependencies":{"parse5":"^3.0.3"},"gitHead":"6c51be6f489822947331033f81a6b7e3b4d46936","_id":"vue-parser@1.1.6","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"prograhammer","email":"prograhammer@gmail.com"},"dist":{"shasum":"3063c8431795664ebe429c23b5506899706e6355","size":2691,"noattachment":false,"key":"/vue-parser/-/vue-parser-1.1.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/vue-parser/download/vue-parser-1.1.6.tgz"},"maintainers":[{"name":"prograhammer","email":"prograhammer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-parser-1.1.6.tgz_1515627504322_0.8584274586755782"},"directories":{},"publish_time":1515627505424,"_hasShrinkwrap":false,"_cnpm_publish_time":1515627505424},"1.1.5":{"name":"vue-parser","version":"1.1.5","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 ","test":"npm run build && mocha -R spec ./test","build":"npm run clean && npm run compile"},"devDependencies":{"chai":"^4.1.2","mocha":"^4.0.1","rimraf":"^2.4.4","tslint":"^5.0.0","tslint-config-standard":"^7.0.0","typescript":"^2.6.2"},"engines":{"node":">= 4.0.0","npm":">= 3.0.0"},"dependencies":{"parse5":"^3.0.3"},"gitHead":"2fa0d2a949260247df0a8c7a2fe60951c78d9419","_id":"vue-parser@1.1.5","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"prograhammer","email":"prograhammer@gmail.com"},"dist":{"shasum":"726ca53ed679114518ebf8a22d7ab43da5d4ee25","size":2773,"noattachment":false,"key":"/vue-parser/-/vue-parser-1.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/vue-parser/download/vue-parser-1.1.5.tgz"},"maintainers":[{"name":"prograhammer","email":"prograhammer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-parser-1.1.5.tgz_1514048655990_0.2590021437499672"},"directories":{},"publish_time":1514048656934,"_hasShrinkwrap":false,"_cnpm_publish_time":1514048656934},"1.1.4":{"name":"vue-parser","version":"1.1.4","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 ","test":"npm run build && mocha -R spec ./test","build":"npm run clean && npm run compile"},"devDependencies":{"chai":"^4.1.2","mocha":"^4.0.1","rimraf":"^2.4.4","tslint":"^5.0.0","tslint-config-standard":"^7.0.0","typescript":"^2.6.2"},"engines":{"node":">= 4.0.0","npm":">= 3.0.0"},"dependencies":{"parse5":"^3.0.3"},"gitHead":"9b37f38a92f7ae23969eb02cc1e6723f7d0ac1ea","_id":"vue-parser@1.1.4","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"prograhammer","email":"prograhammer@gmail.com"},"dist":{"shasum":"b3fba95f27f268a448a25846c8c032078af640eb","size":2688,"noattachment":false,"key":"/vue-parser/-/vue-parser-1.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/vue-parser/download/vue-parser-1.1.4.tgz"},"maintainers":[{"name":"prograhammer","email":"prograhammer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-parser-1.1.4.tgz_1514048086656_0.8102957133669406"},"directories":{},"publish_time":1514048087559,"_hasShrinkwrap":false,"_cnpm_publish_time":1514048087559},"1.1.3":{"name":"vue-parser","version":"1.1.3","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 ","test":"mocha -R spec ./test","build":"npm run clean && npm run compile"},"devDependencies":{"chai":"^4.1.2","mocha":"^4.0.1","rimraf":"^2.4.4","tslint":"^5.0.0","tslint-config-standard":"^7.0.0","typescript":"^2.6.2"},"engines":{"node":">= 4.0.0","npm":">= 3.0.0"},"dependencies":{"parse5":"^3.0.3"},"gitHead":"e4bb6d5ceabdd6179c14ed44014b78ba47f44a08","_id":"vue-parser@1.1.3","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"prograhammer","email":"prograhammer@gmail.com"},"dist":{"shasum":"19aa5600d971e7c8105e440bb5e30ce0fdbf1013","size":2621,"noattachment":false,"key":"/vue-parser/-/vue-parser-1.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/vue-parser/download/vue-parser-1.1.3.tgz"},"maintainers":[{"name":"prograhammer","email":"prograhammer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-parser-1.1.3.tgz_1513354028061_0.45114925783127546"},"directories":{},"publish_time":1513354028848,"_hasShrinkwrap":false,"_cnpm_publish_time":1513354028848},"1.1.0":{"name":"vue-parser","version":"1.1.0","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 ","test":"mocha -R spec ./test","build":"npm run clean && npm run compile"},"devDependencies":{"chai":"^4.1.2","mocha":"^4.0.1","rimraf":"^2.4.4","tslint":"^5.0.0","tslint-config-standard":"^7.0.0","typescript":"^2.6.2"},"engines":{"node":">= 4.0.0","npm":">= 3.0.0"},"dependencies":{"parse5":"^3.0.3"},"gitHead":"0db5c21aed37556490a748139a9f06e3068bec4c","_id":"vue-parser@1.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"prograhammer","email":"prograhammer@gmail.com"},"dist":{"shasum":"2775cdbf87dcb38657071486f445b1619d735177","size":2488,"noattachment":false,"key":"/vue-parser/-/vue-parser-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/vue-parser/download/vue-parser-1.1.0.tgz"},"maintainers":[{"name":"prograhammer","email":"prograhammer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-parser-1.1.0.tgz_1513266855354_0.16990111372433603"},"directories":{},"publish_time":1513266856304,"_cnpm_publish_time":1513266856304,"_hasShrinkwrap":false},"1.0.1":{"name":"vue-parser","version":"1.0.1","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":"75ec951b4253f39058d36f0920cecd91eb515a9a","_id":"vue-parser@1.0.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"prograhammer","email":"prograhammer@gmail.com"},"dist":{"shasum":"82a099add2fa05e9ecb078fe472cd55f5a65d8ef","size":2328,"noattachment":false,"key":"/vue-parser/-/vue-parser-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/vue-parser/download/vue-parser-1.0.1.tgz"},"maintainers":[{"name":"prograhammer","email":"prograhammer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-parser-1.0.1.tgz_1512136539792_0.48509402899071574"},"directories":{},"publish_time":1512136540652,"_hasShrinkwrap":false,"_cnpm_publish_time":1512136540652},"1.0.0":{"name":"vue-parser","version":"1.0.0","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":"d0c164fa0f45c8026cf92df1068ff938036b301d","_id":"vue-parser@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"prograhammer","email":"prograhammer@gmail.com"},"dist":{"shasum":"3f519eeadbc8241d1cf13904e1899eafc2e30048","size":2288,"noattachment":false,"key":"/vue-parser/-/vue-parser-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/vue-parser/download/vue-parser-1.0.0.tgz"},"maintainers":[{"name":"prograhammer","email":"prograhammer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-parser-1.0.0.tgz_1511909145906_0.16997705888934433"},"directories":{},"publish_time":1511909147298,"_cnpm_publish_time":1511909147298,"_hasShrinkwrap":false},"0.0.3":{"name":"vue-parser","version":"0.0.3","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":"d0c164fa0f45c8026cf92df1068ff938036b301d","_id":"vue-parser@0.0.3","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"prograhammer","email":"prograhammer@gmail.com"},"dist":{"shasum":"cf7085f733a0bc4cdacae113d6c835a747020dae","size":1570,"noattachment":false,"key":"/vue-parser/-/vue-parser-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/vue-parser/download/vue-parser-0.0.3.tgz"},"maintainers":[{"name":"prograhammer","email":"prograhammer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-parser-0.0.3.tgz_1511084903865_0.8578097706194967"},"directories":{},"publish_time":1511084904871,"_hasShrinkwrap":false,"_cnpm_publish_time":1511084904871},"0.0.2":{"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":{"shasum":"8b55dab01c8ff04cfbb3296a2eccd52233fc42a1","size":1367,"noattachment":false,"key":"/vue-parser/-/vue-parser-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/vue-parser/download/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":{},"publish_time":1511084468597,"_cnpm_publish_time":1511084468597,"_hasShrinkwrap":false},"0.0.1":{"name":"vue-parser","version":"0.0.1","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":{"parse5":"^3.0.2","rimraf":"^2.4.4","tslint":"^5.0.0","typescript":"^2.0.3"},"engines":{"node":">= 4.0.0","npm":">= 3.0.0"},"gitHead":"7d491f666fa15944f5bf2e1077e43cea1d8c4335","_id":"vue-parser@0.0.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"prograhammer","email":"prograhammer@gmail.com"},"dist":{"shasum":"6c2f9c3df6b0ddd07e01aa7dec48a5ee6640f7f0","size":1368,"noattachment":false,"key":"/vue-parser/-/vue-parser-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/vue-parser/download/vue-parser-0.0.1.tgz"},"maintainers":[{"name":"prograhammer","email":"prograhammer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-parser-0.0.1.tgz_1510797511309_0.1969264056533575"},"directories":{},"publish_time":1510797512322,"_hasShrinkwrap":false,"_cnpm_publish_time":1510797512322}},"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","_attachments":{},"homepage":"https://github.com/prograhammer/vue-parser","bugs":{"url":"https://github.com/prograhammer/vue-parser/issues"},"license":"MIT"}