{"name":"yaml-loader","version":"0.6.0","license":"MIT","description":"YAML loader for Webpack","keywords":["yaml","webpack","loader","json"],"contributors":[{"name":"Andrey Okonetchnikov","email":"andrey@okonet.ru"},{"name":"Eemeli Aro","email":"eemeli@gmail.com"}],"homepage":"https://github.com/eemeli/yaml-loader","bugs":{"url":"https://github.com/eemeli/yaml-loader/issues"},"repository":{"type":"git","url":"git+https://github.com/eemeli/yaml-loader.git"},"main":"index.js","scripts":{"prettier":"prettier --write '**/*.{js,md}'","test":"jest"},"prettier":{"semi":false,"singleQuote":true},"dependencies":{"loader-utils":"^1.4.0","yaml":"^1.8.3"},"devDependencies":{"jest":"^25.1.0","prettier":"^1.19.1"},"engines":{"node":">= 6"},"gitHead":"cdda5c2abbf219464f20423417959cf8cf1e6451","_id":"yaml-loader@0.6.0","_nodeVersion":"13.10.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-1bNiLelumURyj+zvVHOv8Y3dpCri0F2S+DCcmps0pA1zWRLjS+FhZQg4o3aUUDYESh73+pKZNI18bj7stpReow==","shasum":"fe1c48b9f4803dace55a59a1474e790ba6ab1b48","tarball":"http://registry-npm.ywwl.com/yaml-loader/download/yaml-loader-0.6.0.tgz","fileCount":4,"unpackedSize":4823,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedXQZCRA9TVsSAnZWagAAQyMP/iZlfKrOXp9ekAPFIm1a\nKaGq779WyGwIrOSIHPqnSIk3BsOtSD9jTnfM6aREKyPaCPvSjYKtYpakUydF\ngCl0Tt3uzs8DShKxe79vvgvUZgHKGAWlrD2eqZLVT5X3bi5m8b8Aln5Oy0WV\nEYxJD59p9VAgROj4QBj/G0FelCO1NSzdp85KO7zBm6lTVTC7C9KlvBApaYI0\nMK7blaqzNYT1Xfe/RQ38zVTZgftHqw2jEYc9Zzbz3UirxA2OZDc78EozPMFA\n5trTkajByTbU7lkwxZ5HRHrYHZWdRZi8xh/oezUkR/Yx7YomHcXD7+FihVom\n/XTVlohMVmKbRPpCaorNKKQy3nhgIV+76w0+myVxD8IxzGeXV4JWW+zxgA2K\nbmQbtQSkexrwOoIS8fw5yQw2jIfqZ2AW8SRM5SLgjaWU7QiR3DSayQ4HVMiN\nnyf2CPlomdqjTmfIGhlpA6syANcRtsxWev3otNKdYHmtRac9FJVSEMYM9WOq\nhX17jBtbDn4Ha0Ho6be0Z5vizML22eS98qcksJEB4NaBBpmA1VVNYdPpkWgo\n26a9QBMbOlKs1blNzkj3oEQPTan3CtTUtVCZ+rW3CWBo9qX6n2vf5Ojfp1Wf\nj4wXSXp9el0oqXBjgSQo/JAiHBks0t5pgkaHmdm5X331P/Aoy4OztyUfNiJZ\nqLrC\r\n=iZas\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRLBnZ2NQRlm1QV0ySUnP4DcOXPaqKzPsol12Mcg+36wIgBt1N4uN5kotCLVORr6CiAm4bMSc6CHhUq7I9YicUt6g="}],"size":2418,"noattachment":false,"key":"/yaml-loader/-/yaml-loader-0.6.0.tgz"},"maintainers":[{"email":"eemeli@gmail.com","name":"eemeli"},{"email":"andrey@okonet.ru","name":"okonet"}],"_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yaml-loader_0.6.0_1584755737467_0.011762470747534337"},"_hasShrinkwrap":false,"readme":"# yaml-loader for Webpack\n\nYAML loader for [Webpack](https://webpack.js.org/). Allows importing YAML files as JS objects. Uses [`yaml`](https://www.npmjs.com/package/yaml) internally.\n\n## Installation\n\n```sh\nnpm install --save-dev yaml-loader\n```\n\n## Usage\n\n```js\n// webpack.config.js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.ya?ml$/,\n        use: 'yaml-loader'\n      }\n    ]\n  }\n}\n```\n\n```yaml\n# file.yaml\n---\nconfig:\n  js:\n    key: test\nhello: world\n```\n\n```js\n// application.js\nimport file from './file.yaml'\n\nfile.hello === 'world'\n```\n\n## Options\n\nIn addition to all [`yaml` options](https://eemeli.org/yaml/#options) used by its parsing methods,\nthe loader supports the following additional options:\n\n### `asJSON`\n\nIf enabled, the loader output is stringified JSON rather than stringified JavaScript. For Webpack v4, you'll need to set the rule to have `type: \"json\"`. Also useful for chaining with other loaders that expect JSON input.\n\n### `asStream`\n\nIf enabled, parses the source file as a stream of YAML documents. With this, the output will always be an array, with entries for each document. If set, `namespace` is ignored.\n\nTo use this option for only some YAML files, it's probably easiest to use a query parameter and match that using [Rule.resourceQuery](https://webpack.js.org/configuration/module/#ruleresourcequery):\n\n```js\n// webpack.config.js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.ya?ml$/,\n        oneOf: [\n          {\n            resourceQuery: /stream/,\n            options: { asStream: true },\n            loader: 'yaml-loader'\n          },\n          { loader: 'yaml-loader' }\n        ]\n      }\n    ]\n  }\n}\n```\n\nThen, importing `./foo.yaml` will expect it to contain only one document, but `./bar.yaml?stream` may contain multiple documents.\n\n### `namespace`\n\nAllows for exposing a sub-tree of the source document:\n\n```js\nimport jsCfg from './file.yaml?namespace=config.js'\n\njsCfg.key === 'test'\n```\n\nThe `namespace` should be a series of keys, dot separated. Note that any `options` object in your `webpack.config.js` rule will be superseded by a `?query`.\n\n## License\n\n[MIT](http://www.opensource.org/licenses/mit-license.php)\n","publish_time":1584755737628,"_cnpm_publish_time":1584755737628,"dist-tags":{"latest":"0.9.0"}}