Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
dust-loader
Advanced tools
Compiles dust templates and exports the compiled functions, allowing for rendering of the templates in a browser environment.
var template = require('dust!./file.dust');
// => returns file.dust compiled as template function
module.exports = {
module: {
loaders: [
{
test: /\.dust$/,
loader: 'dust-loader'
}
]
},
plugins: [
new webpack.ProvidePlugin({
dust: 'dustjs-linkedin'
})
],
};
Then you only need to write: require('./file.dust')
You can also preserve the whitespace in your template with the following loader config:
{
test: /\.dust$/,
use: {
loader: 'dust-loader',
options: 'preserveWhitespace'
}
}
or
{
test: /\.dust$/,
use: {
loader: 'dust-loader',
options: {
preserveWhitespace: true
}
}
}
Sets the root directory for your dust templates. The rootDir string will be removed from the beginning of the dust module path before it is turned into the template name.
{
test: /\.dust$/,
use: {
loader: 'dust-loader',
options: {
rootDir: 'src/app/templates'
}
}
}
You will need to bundle the dust core in your pack in order to render the compiled templates.
var tpl = require('./views/foo/bar.tpl');
// with dust <= 2.6
dust.render('views/foo/bar', context, function(err, result){
// result holds the rendered HTML code
});
// with dust >= 2.7
dust.render(tpl, context, function(err, result){
// result holds the rendered HTML code
});
FAQs
dustjs loader module for webpack
The npm package dust-loader receives a total of 1,678 weekly downloads. As such, dust-loader popularity was classified as popular.
We found that dust-loader 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.