Gathering detailed insights and metrics for yaml-loader
Gathering detailed insights and metrics for yaml-loader
Gathering detailed insights and metrics for yaml-loader
Gathering detailed insights and metrics for yaml-loader
npm install yaml-loader
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.1
Supply Chain
97.8
Quality
77.9
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
157,351,828
Last Day
31,340
Last Week
545,944
Last Month
2,339,117
Last Year
25,268,115
MIT License
154 Stars
70 Commits
27 Forks
2 Watchers
3 Branches
10 Contributors
Updated on Jun 25, 2025
Minified
Minified + Gzipped
Latest Version
0.8.1
Package Id
yaml-loader@0.8.1
Unpacked Size
6.43 kB
Size
3.04 kB
File Count
4
NPM Version
10.1.0
Node Version
20.8.0
Published on
Feb 21, 2024
Cumulative downloads
Total Downloads
Last Day
-5.6%
31,340
Compared to previous day
Last Week
-4.1%
545,944
Compared to previous week
Last Month
1.9%
2,339,117
Compared to previous month
Last Year
-6.1%
25,268,115
Compared to previous year
3
YAML loader for Webpack. Allows importing YAML files as JS objects. Uses yaml
internally.
1npm install --save-dev yaml-loader
1// webpack.config.js 2module.exports = { 3 module: { 4 rules: [ 5 { 6 test: /\.ya?ml$/, 7 use: 'yaml-loader' 8 } 9 ] 10 } 11}
1# file.yaml 2--- 3config: 4 js: 5 key: test 6hello: world
1// application.js 2import file from './file.yaml' 3 4file.hello === 'world'
In addition to all yaml
options used by its parsing methods,
the loader supports the following additional options:
asJSON
If 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.
asStream
If 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.
To use this option for only some YAML files, it's probably easiest to use a query parameter and match that using Rule.resourceQuery:
1// webpack.config.js 2module.exports = { 3 module: { 4 rules: [ 5 { 6 test: /\.ya?ml$/, 7 oneOf: [ 8 { 9 resourceQuery: /stream/, 10 options: { asStream: true }, 11 loader: 'yaml-loader' 12 }, 13 { loader: 'yaml-loader' } 14 ] 15 } 16 ] 17 } 18}
Then, importing ./foo.yaml
will expect it to contain only one document, but ./bar.yaml?stream
may contain multiple documents.
namespace
Allows for exposing a sub-tree of the source document:
1import jsCfg from './file.yaml?namespace=config.js' 2 3jsCfg.key === 'test'
The 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
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
6 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/29 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More