Installations
npm install dwy-mustache-loader
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=4.0.0
Node Version
8.5.0
NPM Version
5.4.2
Score
58.6
Supply Chain
92.4
Quality
73.6
Maintenance
50
Vulnerability
99.1
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (98.61%)
HTML (1.39%)
Total Downloads
Cumulative downloads
Total Downloads
944
Last day
0%
1
Compared to previous day
Last week
-50%
1
Compared to previous week
Last month
200%
3
Compared to previous month
Last year
-25.6%
67
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Mustache loader for webpack
Compiles Mustache templates with Hogan and optionally html-minifier.
Install
1$ npm i -S dwy-mustache-loader
Usage
1module: { 2 loaders: [ { 3 test: /\.html$/, 4 loader: 'dwy-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: 'dwy-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.
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: 'dwy-mustache-loader', 5 options: { 6 tiny: true, 7 render: { 8 title: 'hello world', 9 }, 10 partials:{ 11 header:``, 12 footer:`` 13 } 14 }, 15 } ] 16} 17plugins: [ 18 new HtmlWebpackPlugin({ 19 template: 'index.mustache', 20 inject: 'body', 21 }), 22]
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
0 existing vulnerabilities detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
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'
Score
3
/10
Last Scanned on 2024-12-16
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