Installations
npm install dynamic-app-templater
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
10.9.0
NPM Version
6.4.1
Score
63.8
Supply Chain
95.8
Quality
75
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
dynamic-app
Download Statistics
Total Downloads
463
Last Day
2
Last Week
2
Last Month
6
Last Year
60
GitHub Statistics
2 Commits
2 Watching
1 Branches
1 Contributors
Package Meta Information
Latest Version
1.0.0
Package Id
dynamic-app-templater@1.0.0
Unpacked Size
4.05 kB
Size
1.96 kB
File Count
4
NPM Version
6.4.1
Node Version
10.9.0
Total Downloads
Cumulative downloads
Total Downloads
463
Last day
0%
2
Compared to previous day
Last week
100%
2
Compared to previous week
Last month
200%
6
Compared to previous month
Last year
-32.6%
60
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
No dependencies detected.
Templater
Template strings es6 helper (onEvent, map, find).
Templater(el, component, props);
Example
1import Templater from 'dynamic-app-templater'; 2 3function myComponent({ map, onEvent, find }, props) { 4 5 onEvent('h1', 'click', function() { 6 find('.find-my').innerHTML = 'find you!!!'; 7 }) 8 9 return ` 10 <h1>Simpale Template</h1> 11 <div class="find-my">find my</div> 12 <ul> 13 ${map(props, (item, key) =>` 14 <li>${key} - ${item}</li> 15 `)} 16 </ul> 17 `; 18} 19 20const props = { 1: 'one', 2: 'two', 3: 'three' }; 21 22Templater(document.body, myComponent, props);
The benefits
Map
Templater:
1// map(object || array, renderFunction) 2map(items, (item, key) => 3 `<div>${ item }</div>` 4)
without Templater:
1// Object.keys().map().join() 2Object.keys(items).map((itemId, index) => 3 `<div>${ items[itemId] }</div>` 4).join('')
Events
Templater:
1// onEvent(cssSelector, eventType, eventFunction) 2// - using reletive selector path 3// - can add event before element is connected to the DOM 4// - without jQuery 5onEvent('h1', 'click', () => {})
without Templater:
1// native-js: 2document.querySelector('#my_component h1').addEventListener('click', () => {}) 3 4// jQuery: 5$('#my_component h1').on('click', () => {})
Find
Templater:
1// find(cssSelector) 2// - using reletive selector path 3// - can use only in onEvent function 4// - without jQuery 5find('h1').innerHTML;
without Templater:
1// native-js:
2document.querySelector('#my_component h1').innerHTML;
3
4// jQuery:
5$('#my_component h1').html()
Component writing
Templater:
1function myComponent({ map, onEvent, find }, props) {
2 const items = {};
3
4 return `
5 <h1>My template</h1>
6 `;
7}
8
9Templater(el, myComponent, props);
license
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/2 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
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
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
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