{"_id":"@dword-design/vue-sfc-descriptor-to-string","_rev":"3-61144f06df3ee50dfa8505b09429f303","name":"@dword-design/vue-sfc-descriptor-to-string","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@dword-design/vue-sfc-descriptor-to-string","version":"0.0.1","description":"Convert SFCDescriptor to source","main":"index.js","type":"module","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js"},"homepage":"https://github.com/psalaets/vue-sfc-descriptor-to-string","repository":{"type":"git","url":"git+https://github.com/psalaets/vue-sfc-descriptor-to-string.git"},"keywords":["vue","sfc","parse","stringify"],"author":{"name":"Paul Salaets","email":"psalaets@gmail.com"},"license":"MIT","devDependencies":{"jest":"^29.5.0"},"dependencies":{"@vue/compiler-sfc":"^3.3.4","indent-string":"^5.0.0"},"gitHead":"0221c9dca3ea46cce0f00a4e067af710740a1255","bugs":{"url":"https://github.com/psalaets/vue-sfc-descriptor-to-string/issues"},"_id":"@dword-design/vue-sfc-descriptor-to-string@0.0.1","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-YNqOau4H4lJt4HjGzuO1YHbB/HypOs8lrTSrL+5Eqb03m9nGsSC7g6JX3gL0Crx75+65+Zjm6DdyuCc2X8hPdg==","shasum":"a16d40783c2cb7bd41f5f20f8cf08ba8e29c7f48","tarball":"https://registry.npmjs.org/@dword-design/vue-sfc-descriptor-to-string/-/vue-sfc-descriptor-to-string-0.0.1.tgz","fileCount":19,"unpackedSize":13569,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVZ8Vjvq5BOBP+B5EqFAzuuTfqd/R3BBlYmVS0rObPvAIgEyL6h7MiSeBjXix6tAFEfQbgf90mXrJHv40EELqsrkY="}]},"_npmUser":{"name":"dword-design","email":"info@sebastianlandwehr.com"},"directories":{},"maintainers":[{"name":"dword-design","email":"info@sebastianlandwehr.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-sfc-descriptor-to-string_0.0.1_1685643498038_0.023300058145523828"},"_hasShrinkwrap":false,"deprecated":"upstream-updated"},"0.0.2":{"name":"@dword-design/vue-sfc-descriptor-to-string","version":"0.0.2","description":"Convert SFCDescriptor to source","main":"index.js","type":"module","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js"},"homepage":"https://github.com/psalaets/vue-sfc-descriptor-to-string","repository":{"type":"git","url":"git+https://github.com/psalaets/vue-sfc-descriptor-to-string.git"},"keywords":["vue","sfc","parse","stringify"],"author":{"name":"Paul Salaets","email":"psalaets@gmail.com"},"license":"MIT","devDependencies":{"jest":"^29.5.0"},"dependencies":{"@vue/compiler-sfc":"^3.3.4","indent-string":"^5.0.0"},"gitHead":"b472867c8324d35aa4671c404a39bd213bc03752","bugs":{"url":"https://github.com/psalaets/vue-sfc-descriptor-to-string/issues"},"_id":"@dword-design/vue-sfc-descriptor-to-string@0.0.2","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-D9yUTfvnExlNvKnD/JxLenkH/iaFgcX7wn6QOOaYAsXHUGJ7jwSbxzW41od8Nq9fN/gje2PdVjuwR9jrMIGBkw==","shasum":"9a8198f8c50b485ec9164a896da97285b83b890b","tarball":"https://registry.npmjs.org/@dword-design/vue-sfc-descriptor-to-string/-/vue-sfc-descriptor-to-string-0.0.2.tgz","fileCount":21,"unpackedSize":14899,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWvXfSxSNcQSJWtmWKeYm2huC2gwrkfQIZhCX9RjGYIAIhAL6jtHOaOc0hRUsmjs3x/H64qOWjnuhE+YPrRL2mWDIK"}]},"_npmUser":{"name":"dword-design","email":"info@sebastianlandwehr.com"},"directories":{},"maintainers":[{"name":"dword-design","email":"info@sebastianlandwehr.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-sfc-descriptor-to-string_0.0.2_1685650783321_0.2844006074419061"},"_hasShrinkwrap":false,"deprecated":"upstream-updated"}},"time":{"created":"2023-06-01T18:18:17.974Z","0.0.1":"2023-06-01T18:18:18.216Z","modified":"2023-07-01T13:04:36.852Z","0.0.2":"2023-06-01T20:19:43.491Z"},"maintainers":[{"name":"dword-design","email":"info@sebastianlandwehr.com"}],"description":"Convert SFCDescriptor to source","homepage":"https://github.com/psalaets/vue-sfc-descriptor-to-string","keywords":["vue","sfc","parse","stringify"],"repository":{"type":"git","url":"git+https://github.com/psalaets/vue-sfc-descriptor-to-string.git"},"author":{"name":"Paul Salaets","email":"psalaets@gmail.com"},"bugs":{"url":"https://github.com/psalaets/vue-sfc-descriptor-to-string/issues"},"license":"MIT","readme":"# vue-sfc-descriptor-to-string\n\nConvert SFCDescriptor to source\n\n## Install\n\n`npm install vue-sfc-descriptor-to-string`\n\n## Usage\n\n```js\n// parse an sfc\nconst compiler = require('vue-template-compiler');\nconst sfcDescriptor = compiler.parseComponent(sfcSource);\n\n// convert sfc descriptor back to source\nconst toString = require('vue-sfc-descriptor-to-string');\nconst result = toString(sfcDescriptor);\n\nresult == sfcSource // => true, but see caveats below\n```\n\n## API\n\n```js\nconst toString = require('vue-sfc-descriptor-to-string');\n```\n\n### `toString(SFCDescriptor, options)`\n\n#### SFCDescriptor\n\nObject that looks like an [SFCDescriptor](https://github.com/vuejs/vue/blob/dev/flow/compiler.js#L177)\n\n#### options\n\nOptional object, defaults to `{}`\n\n##### options.indents\n\nOptional object that can have a property for each sfc block name (e.g. `template`). Values are the number of spaces to indent that block's content.\n\nDefaults to\n\n```js\n{\n  template: 2,\n  script: 0,\n  style: 0\n}\n```\n\n## Caveats\n\nThis module isn't a true inverse of `compiler.parseComponent()` because it doesn't always produce the exact same sfc compared to what was parsed. It assumes the parsed sfc\n\n- ends with a single newline\n- has a single space before each attribute on `<script>`, `<template>`, `<style>`\n- has attributes in abc order on `<script>`, `<template>`, `<style>`\n- other stuff\n\n## License\n\nMIT","readmeFilename":"README.md"}