Registry / serialization / yml-loader

yml-loader

JSON →
library2.1.0jsnpmunverified

YAML loader for webpack that imports .yml files as JSON objects. Version 2.1.0 is the latest stable release. This loader supports multiple documents via the `multiDocument` option and key blacklisting via `keysToRemove` to exclude sensitive keys from output. It is commonly used in webpack configurations to load YAML configuration files. The package is unmaintained since 2019 and relies on `js-yaml` for parsing. Alternatives like `yaml-loader` offer more active maintenance and broader compatibility with webpack 4+.

npm install yml-loader
INSTALL
IMPORT
SIG · YML-LOADER
Y
yml-loader
serializationjavascriptv2.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

yml-loader
import yml from 'yml-loader'
const yml = require('yml-loader')
Loader is used in webpack config, not in application code. Import syntax shown is illustrative; actual usage is via webpack loader string.
webpack config
module.exports = { module: { rules: [ { test: /\.yml$/, use: 'yml-loader' } ] } }
module.exports = { module: { loaders: [ { test: /\.yml$/, loader: 'yml' } ] } }
Webpack 1 uses `loaders` with `loader`; webpack 2+ uses `rules` with `use`. This package documentation still shows webpack 1 style.

Shows how to configure webpack to load YAML files using yml-loader with key removal option.

// In webpack config module.exports = { module: { rules: [ { test: /\.ya?ml$/, use: [ { loader: 'yml-loader', options: { keysToRemove: ['private_key'] } } ] } ] } }; // Then in your code import config from './config.yml'; console.log(config); // outputs parsed YAML as JS object
Debug
Known issues
breakingWebpack 1 loader syntax is incompatible with webpack 2+. Use `rules` and `use` instead of `loaders` and `loader`.
fix
Use `module.rules` array with `use` property for webpack 2+.
affects: >=0.0.0 <2.0.0
deprecatedPackage is unmaintained since 2019; no updates for webpack 5 compatibility.
fix
Consider migrating to `yaml-loader` (npm: yaml-loader) which is actively maintained.
affects: >=0.0.0
Errors
Common errors & fixes
Module not found: Error: Can't resolve 'yml-loader'
Loader not installed or not in node_modules.
fix
Install with `npm install --save-dev yml-loader`.
Module build failed: Error: Cannot find module 'js-yaml'
Missing peer dependency `js-yaml`.
fix
Install `js-yaml` with `npm install --save-dev js-yaml`.
Upgrade
Version history
2.1.0latest on npm
Audit
Dependencies
js-yamlrequiredCore YAML parsing dependency. Used to load and parse YAML files.
webpackoptionalPeer dependency; loader is designed for webpack bundler.
Agent activity
30 hits · last 30 days
node
26
OpenAI (training)
1
Resources
yml-loader — npm install yml-loader · libregistry