
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
npm-html2js
Advanced tools
Standalone script to load all your Angular html/jade templates into the $templateCache using npm
Use npm as a build tool to load all your jade/html templates into your $templateCache.
$ npm-html2js -i 'src/**/*.jade' -o 'dist/template.js'
angular.module('template.js', []);
.run(['$templateCache', function($templateCache) {
.$templateCache.put('files/file1.tpl.jade',
'<div>\n' +
' <h1>Hello World from file1!</h1>\n' +
'</div>')
.$templateCache.put('files/file2.tpl.jade',
'<div>\n' +
' <h1>Hello World from file2!</h1>\n' +
'</div>')
.$templateCache.put('files/subfolder/subfile1.tpl.jade',
'<div>\n' +
' <h1>Hello World from subfile1!</h1>\n' +
'</div>')
.$templateCache.put('files/subfolder/subfile2.tpl.jade',
'<div>\n' +
' <h1>Hello World from subfile2!</h1>\n' +
'</div>')
}]);
Via npm:
npm install --save-dev npm-html2js
And load it in your build process in your package.json
:
"scripts": {
"build": "npm-html2js -i 'files/**/*.html' -o 'dist/template.js'"
},
Path to your templates. The module supports globbing so you can use path like src/**/*.tpl.html
example:
npm-html2js -i 'files/**/*.tpl.html'
Path to the expected output file.
example:
npm-html2js ... -o 'dist/template.js'
The name of the parent Angular module for each set of templates. Defaults to the task target prefixed by templates.js
example:
npm-html2js ... -m 'myModule'
if the filename ends with .jade
, the task will automatically render file's content using Jade then comile into JS
The prefix relative to the project directory that should be stripped from each template path to produce a module identifier for the template. For example, a template located at src/projects/projects.tpl.html
would be identified as just projects/projects.tpl.html
.
example:
npm-html2js ... -b 'src'
Display the command line options
FAQs
Standalone script to load all your Angular html/jade templates into the $templateCache using npm
We found that npm-html2js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.