Gathering detailed insights and metrics for mustache-loader
Gathering detailed insights and metrics for mustache-loader
Gathering detailed insights and metrics for mustache-loader
Gathering detailed insights and metrics for mustache-loader
npm install mustache-loader
Typescript
Module System
Min. Node Version
Node Version
NPM Version
75.2
Supply Chain
92.6
Quality
77
Maintenance
50
Vulnerability
99.1
License
JavaScript (98.78%)
HTML (1.22%)
Total Downloads
4,635,251
Last Day
167
Last Week
3,966
Last Month
28,428
Last Year
449,363
39 Stars
65 Commits
31 Forks
3 Watching
1 Branches
14 Contributors
Latest Version
1.4.3
Package Id
mustache-loader@1.4.3
Unpacked Size
7.97 kB
Size
2.75 kB
File Count
4
NPM Version
5.6.0
Node Version
9.11.2
Cumulative downloads
Total Downloads
Last day
-89.3%
167
Compared to previous day
Last week
-46.8%
3,966
Compared to previous week
Last month
-18.4%
28,428
Compared to previous month
Last year
8%
449,363
Compared to previous year
3
Compiles Mustache templates with Hogan and optionally html-minifier.
1$ npm i -S mustache-loader
1module: { 2 loaders: [ { 3 test: /\.html$/, 4 loader: 'mustache' 5 // loader: 'mustache?minify' 6 // loader: 'mustache?{ minify: { removeComments: false } }' 7 // loader: 'mustache?noShortcut' 8 } ] 9}
1module: { 2 rules: [ { 3 test: /\.html$/, 4 loader: 'mustache-loader' 5 // loader: 'mustache-loader?minify' 6 // loader: 'mustache-loader?{ minify: { removeComments: false } }' 7 // loader: 'mustache-loader?noShortcut' 8 } ] 9}
1var template = require('./template.html'); 2var html = template({ foo: 'bar' });
If noShortcut
is passed, then Hogan compiled template is returned instead, so
you can pass it as partial.
1var template = require('./template.html'); 2var template2 = require('./template2.html'); 3var html = template.render({ foo: 'bar' }, {partial: template2});
If clientSide
is passed in, then Hogan will not pre-compile the template.
If tiny
is passed in, the source of the template will not be emitted, creating a smaller output.
if render
is passed in, the data is sent is used to immediately render the template. Render may be an object or a function which returns an object (in order to allow the data to change over time, e.g. to support hot reloading).
For example, the following will render index.mustache
with the provided data (title
), which can immediately be used by HtmlWebpackPlugin.
1module: { 2 rules: [ { 3 test: /index\.mustache$/, 4 loader: 'mustache-loader', 5 options: { 6 tiny: true, 7 render: { 8 title: 'hello world', 9 }, 10 }, 11 } ] 12} 13plugins: [ 14 new HtmlWebpackPlugin({ 15 template: 'index.mustache', 16 inject: 'body', 17 }), 18]
If another loader is chained after Mustache-Loader then the minify
, clientSide
, and tiny
options will be ignored.
Any additional Hogan parameters passed into this loader will be passed through to Hogan.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 8/28 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
22 existing vulnerabilities detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-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