{"id":14985663,"url":"https://github.com/nkt/yml-loader","last_synced_at":"2025-04-11T22:04:47.765Z","repository":{"id":57403910,"uuid":"64235694","full_name":"nkt/yml-loader","owner":"nkt","description":"YAML loader for webpack","archived":false,"fork":false,"pushed_at":"2022-12-08T22:38:01.000Z","size":17,"stargazers_count":21,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T22:04:09.659Z","etag":null,"topics":["webpack-loader","yaml","yml"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/yml-loader","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nkt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-26T16:08:54.000Z","updated_at":"2025-02-28T11:00:06.000Z","dependencies_parsed_at":"2023-01-25T07:45:17.551Z","dependency_job_id":null,"html_url":"https://github.com/nkt/yml-loader","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkt%2Fyml-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkt%2Fyml-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkt%2Fyml-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkt%2Fyml-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nkt","download_url":"https://codeload.github.com/nkt/yml-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487716,"owners_count":21112191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["webpack-loader","yaml","yml"],"created_at":"2024-09-24T14:11:27.050Z","updated_at":"2025-04-11T22:04:47.716Z","avatar_url":"https://github.com/nkt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"YAML Loader\n===========\n\nYAML loader for [webpack](https://webpack.github.io).\n\n\nInstallation\n------------\n\n```\nnpm install --save-dev yml-loader\n```\n\nUsage\n-----\n\n```js\n// webpack.config.js\n\nmodule.exports = {\n  module: {\n    loaders: [\n      {\n        test: /\\.yml$/,\n        loader: 'yml'\n      }\n    ]\n  }\n};\n```\n\nMultiple document loading\n-------------------------\n\nBy adding a `multiDocument` option will make this possible.\n\n```yaml\n%YAML 1.2\n---\ndoc: 1\n---\ndoc: 2\n...\n```\n\n\nBlacklisting keys\n-----------------\n\nWhen passed a `keysToRemove` query (`Array` of `String`s) to remove keys from the loader output.\n\nGiven input file:\n```yaml\ndevelopment:\n  public_key: \"this is needed on the client\"\n  private_key: \"should be restricted to server\"\nprod:\n  public_key: \"also needed on the client\"\n  private_key: \"missile launch codes ¯\\_(ツ)_/¯\"\n```\nAnd this loader config:\n```js\n// webpack.config.js under module.exports.module:\nloaders: [\n  {\n    test: /\\.ya?ml$/,\n    loader: 'yml',\n    query: {\n      // debug: true, // enable to display removed keys\n      keysToRemove: ['private_key', ],\n    },\n  },\n],\n```\nWill output:\n```js\n{\n  development: { public_key: 'this is needed on the client' },\n  prod: { public_key: 'also needed on the client' }\n}\n```\n\nLicense\n-------\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkt%2Fyml-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnkt%2Fyml-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkt%2Fyml-loader/lists"}