{"_id":"@123ishatest/content-parser","_rev":"11-a71d47ab7768c7e45a0787e16a77ce27","name":"@123ishatest/content-parser","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@123ishatest/content-parser","version":"1.0.0","author":{"name":"Isha"},"license":"MIT","_id":"@123ishatest/content-parser@1.0.0","maintainers":[{"name":"ishad","email":"ishadijcks@gmail.com"}],"homepage":"https://github.com/123ishaTest/content-parser","bugs":{"url":"https://github.com/123ishaTest/content-parser/issues","email":"ishadijcks@gmail.com"},"dist":{"shasum":"44c3e4e04d21ff9b874938c54dd5d250efbd6c27","tarball":"https://registry.npmjs.org/@123ishatest/content-parser/-/content-parser-1.0.0.tgz","fileCount":4,"integrity":"sha512-pKShVF88NepuVSGQRoNmsgcwboWHq3uI38VdtGVKKjNqvQ0vNud/b+GJ4dITd5I0p4BtD1dafbZfZtyO/96UUw==","signatures":[{"sig":"MEUCIF/HDu4h+KtbFm+E6mOyOi8qWNSlm8oUXzsav1ExtmTSAiEA7otXu/m3QqmtOrsyurE1m+31JNeXNDih6/zCGVplPvw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":302645},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"ef8bf6f3959193eb9de8550ffb4509e985db7edb","scripts":{"dev":"vite","lint":"prettier --check .","test":"vitest","build":"tsc && vite build","format":"prettier --write .","preview":"vite preview","release":"npm run build && npx changeset publish"},"_npmUser":{"name":"ishad","email":"ishadijcks@gmail.com"},"_npmVersion":"10.8.2","description":"A utility library that parses YAML files based on Zod schemas","directories":{},"_nodeVersion":"20.18.0","dependencies":{"zod":"^3.23.8","zod-validation-error":"^3.4.0"},"_hasShrinkwrap":false,"devDependencies":{"glob":"^11.0.0","vite":"^5.4.9","yaml":"^2.3.4","vitest":"^2.1.3","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^22.7.7","@changesets/cli":"^2.27.1","vite-plugin-dts":"^3.9.1","vite-tsconfig-paths":"^5.0.1","@changesets/changelog-github":"^0.5.0"},"_npmOperationalInternal":{"tmp":"tmp/content-parser_1.0.0_1729379260897_0.7001885777806569","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@123ishatest/content-parser","version":"1.0.1","author":{"name":"Isha"},"license":"MIT","_id":"@123ishatest/content-parser@1.0.1","maintainers":[{"name":"ishad","email":"ishadijcks@gmail.com"}],"homepage":"https://github.com/123ishaTest/content-parser","bugs":{"url":"https://github.com/123ishaTest/content-parser/issues","email":"ishadijcks@gmail.com"},"dist":{"shasum":"fcffd50b2b7d4b1391bf3d94db167d765061bb69","tarball":"https://registry.npmjs.org/@123ishatest/content-parser/-/content-parser-1.0.1.tgz","fileCount":4,"integrity":"sha512-BPqbdmfkk8GrpYkLGi3IgSvhRIjSQDufuAsgBR0pG0EIWFBJjkoyRKVkvhFtB4QrQrUn8oi94XwWTq4CBGKidw==","signatures":[{"sig":"MEQCIAI2SB6+aQpoPY6Q+P5UFC/aWRRklm7cqXDYe6PMmnTPAiAs2xGikIKI7zk3sSEPfO0aPKJKqywl+I38PjUrjMI+3w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":302645},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"22bcba026337fa9d09a482da063d9cc70ae49226","scripts":{"dev":"vite","lint":"prettier --check .","test":"vitest","build":"tsc && vite build","format":"prettier --write .","preview":"vite preview","release":"npm run build && npx changeset publish"},"_npmUser":{"name":"ishad","email":"ishadijcks@gmail.com"},"_npmVersion":"10.8.2","description":"A utility library that parses YAML files based on Zod schemas","directories":{},"_nodeVersion":"20.18.0","dependencies":{"zod":"^3.23.8","zod-validation-error":"^3.4.0"},"_hasShrinkwrap":false,"devDependencies":{"glob":"^11.0.0","vite":"^5.4.9","yaml":"^2.3.4","vitest":"^2.1.3","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^22.7.7","@changesets/cli":"^2.27.1","vite-plugin-dts":"^3.9.1","vite-tsconfig-paths":"^5.0.1","@changesets/changelog-github":"^0.5.0"},"_npmOperationalInternal":{"tmp":"tmp/content-parser_1.0.1_1729380394180_0.3203773970998838","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@123ishatest/content-parser","version":"1.0.2","description":"A utility library that parses YAML files based on Zod schemas","homepage":"https://github.com/123ishaTest/content-parser","bugs":{"url":"https://github.com/123ishaTest/content-parser/issues","email":"ishadijcks@gmail.com"},"author":{"name":"Isha"},"license":"MIT","type":"module","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"dev":"vite","build":"tsc && vite build","release":"npm run build && npx changeset publish","preview":"vite preview","lint":"prettier --check .","format":"prettier --write .","test":"vitest"},"dependencies":{"@types/node":"^22.7.7","glob":"^11.0.0","yaml":"^2.3.4","zod":"^3.23.8","zod-validation-error":"^3.4.0"},"devDependencies":{"@changesets/changelog-github":"^0.5.0","@changesets/cli":"^2.27.1","prettier":"^3.3.3","typescript":"^5.6.3","vite":"^5.4.9","vite-plugin-dts":"^3.9.1","vite-tsconfig-paths":"^5.0.1","vitest":"^2.1.3"},"_id":"@123ishatest/content-parser@1.0.2","gitHead":"84d45b2b7dd5639b499044e813184175e935474a","_nodeVersion":"20.18.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-6krSRUe5NhRR7NhekCE6JEIZwI1u/ew2NGo2oHByR3rEEVHNFWAXCA0U2xPraumos6uG4bTR4i78thD/bV8/lw==","shasum":"19a1d58931e5eda4e1bc72efccdcdf114c660572","tarball":"https://registry.npmjs.org/@123ishatest/content-parser/-/content-parser-1.0.2.tgz","fileCount":4,"unpackedSize":10361,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD30leAL/JA/aV7vs6M396itDDMZsnsXdEFF/uFFj5hegIgEydTu1u/lAt9V3HqQi6SMlZHSc4qFCrEVrFz3/C0Nec="}]},"_npmUser":{"name":"ishad","email":"ishadijcks@gmail.com"},"directories":{},"maintainers":[{"name":"ishad","email":"ishadijcks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/content-parser_1.0.2_1729381717234_0.29058593803963095"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-19T23:07:40.797Z","modified":"2024-10-19T23:48:37.589Z","0.0.0":"2024-02-17T13:25:36.124Z","0.0.1":"2024-02-17T13:37:05.669Z","0.0.2":"2024-02-17T13:38:36.440Z","0.0.3":"2024-02-17T13:39:11.028Z","0.0.4":"2024-02-17T13:52:19.391Z","0.0.5":"2024-02-17T13:56:06.766Z","1.0.0":"2024-10-19T23:07:41.089Z","1.0.1":"2024-10-19T23:26:34.357Z","1.0.2":"2024-10-19T23:48:37.414Z"},"bugs":{"url":"https://github.com/123ishaTest/content-parser/issues","email":"ishadijcks@gmail.com"},"author":{"name":"Isha"},"license":"MIT","homepage":"https://github.com/123ishaTest/content-parser","description":"A utility library that parses YAML files based on Zod schemas","maintainers":[{"name":"ishad","email":"ishadijcks@gmail.com"}],"readme":"# Content Parser\n\n> A utility library that parses YAML files based on Zod schemas\n>\n> The perfect way to manage your game content :)\n\n## Usage\n\nCreate a content type with a [Zod](https://zod.dev) schema.\n\n```ts\nexport const ItemDetailSchema = z\n  .object({\n    hrid: z.string(),\n    name: z.string(),\n    description: z.string(),\n  })\n  .strict();\n```\n\nCreate your content in YAML files.\n\n```yaml\n# fish.item.yaml\nhrid: /items/fish\nname: Regular Fish\ndescription: Goes blub\n```\n\nAnd use the `ContentParser` to grab it.\n\n```ts\nconst parser = new ContentParser({\n  // The name of the key here determines the file.<name>.yaml that is searched.\n  item: ItemDetailSchema,\n});\n\nconst result = parser.parse({\n  root: '/path/to/content',\n  debug: true,\n  idKey: 'hrid',\n});\n\n// Enjoy your content!\nconst items = parser.getContent('item');\nconst fish = items['/items/fish'];\nconst description = fish.description;\n\n// Full TS support!\nparser.getContent('wrongType'); // TS2345: Argument of type 'wrongType' is not assignable to parameter of type 'item'\nfish.invalidAttribute; // TS2339: Property invalidAttribute does not exist on type ItemDetail\n```\n\n## Development\n\nIf you want to contribute to this project,\n","readmeFilename":"README.md"}