Gathering detailed insights and metrics for web-es6-templates
Gathering detailed insights and metrics for web-es6-templates
npm install web-es6-templates
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
5,475
Last Day
1
Last Week
7
Last Month
22
Last Year
359
55 Commits
1 Forks
1 Watching
1 Branches
2 Contributors
Minified
Minified + Gzipped
Latest Version
1.1.6
Package Id
web-es6-templates@1.1.6
Unpacked Size
16.67 kB
Size
6.07 kB
File Count
15
NPM Version
5.5.1
Node Version
6.11.2
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
-36.4%
7
Compared to previous week
Last month
83.3%
22
Compared to previous month
Last year
-6.5%
359
Compared to previous year
This module allows native ES6 template literals to be used with DADI Web.
Add this module as a dependency:
npm install web-es6-templates --save
Include it in the engines
array passed to Web:
1require('@dadi/web')({ 2 engines: [ 3 require('web-es6-templates') 4 ] 5})
You can change the folder where your helpers are stored in your config.xxx.json
file:
1 "engines": { 2 "es6": { 3 "paths": { 4 "helpers": "site/helpers" 5 } 6 } 7 }
The base directory for absolute paths is the utils/helpers
directory.
Helpers are required()
functions that can be embeded into templates to keep your code DRY. Take this example which could live in your helpers
folder as slugify.js
.
1var s = require('underscore.string/slugify') 2 3module.exports.slugify = (chunk) => { 4 return s(chunk) 5}
This function would be used in a template file like so:
1${slugify('The Quick Brown Fox Jumps Over The Lazy Dog')}
Output:
the-quick-brown-fox-jumps-over-the-lazy-dog
The base directory for absolute paths is the pages/
directory. Take the following directory tree.
pages/
|_ partials/
|_ |_ header.js
|_ |_ footer.js
|_ index.js
|_ index.json
To include the partials from index.js
, you can use an underscore to indicate a sub-folder:
1${partials_header} 2 3<h1>ES6 Templates test</h1> 4 5<p>This page lives at ${host}.</p> 6 7<h2>Loop test</h2> 8 9<ul> 10 ${posts.results.map(i => `<li>${i.attributes.title}</li>`).join('')} 11</ul> 12 13${partials_footer}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 3/27 approved changesets -- score normalized to 1
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
license 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-01-27
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