Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
karma-handlebars-preprocessor
Advanced tools
A Karma plugin. Compile handlebars template on the fly.
Preprocessor to compile Handlebars on the fly.
Forked from hanachin's code (kudos!)
Works with Karma 0.9 or later.
For more information on Karma see the homepage.
$ npm install karma-handlebars-preprocessor --save-dev
preprocessors: {
'**/*.hbs': 'handlebars'
}
or pass through the command line
$ karma start --preprocessors handlebars
You can configure default behaviour in the handlebarsPreprocessor
section of the config file. The following shows the default implementation:
// karma.conf.js
module.exports = function(config) {
config.set({
preprocessors: {
'**/*.hbs': ['handlebars']
},
handlebarsPreprocessor: {
// name of the variable to store the templates hash
templates: "Handlebars.templates",
// translates original file path to template name
templateName: function(filepath) {
return filepath.replace(/^.*\/([^\/]+)\.hbs$/, '$1');
},
// transforms original file path to path of the processed file
transformPath: function(path) {
return path.replace(/\.hbs$/, '.js');
}
}
});
};
If you want to export your compiled templates as anonymous AMD modules,
use the amd
option in the config as shown below:
handlebarsPreprocessor: {
amd: true
}
MIT License
FAQs
A Karma plugin. Compile handlebars template on the fly.
The npm package karma-handlebars-preprocessor receives a total of 263 weekly downloads. As such, karma-handlebars-preprocessor popularity was classified as not popular.
We found that karma-handlebars-preprocessor 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.