Installations
npm install mustache-loader
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=4.0.0
Node Version
9.11.2
NPM Version
5.6.0
Score
75.2
Supply Chain
92.6
Quality
77
Maintenance
50
Vulnerability
99.1
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (98.78%)
HTML (1.22%)
Developer
deepsweet
Download Statistics
Total Downloads
4,635,251
Last Day
167
Last Week
3,966
Last Month
28,428
Last Year
449,363
GitHub Statistics
39 Stars
65 Commits
31 Forks
3 Watching
1 Branches
14 Contributors
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
4,635,251
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
3
Mustache loader for webpack
Compiles Mustache templates with Hogan and optionally html-minifier.
Install
1$ npm i -S mustache-loader
Usage
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.
License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: Do What The F*ck You Want To Public License: LICENSE:0
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
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
22 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-6chw-6frg-f759
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-3gx7-xhv7-5mx3
- Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5
- Warn: Project is vulnerable to: GHSA-pfq8-rq6v-vf5m
- Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546
- Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 11 are checked with a SAST tool
Score
2
/10
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