
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
load-templates
Advanced tools
Load templates.
Install with npm
$ npm i load-templates --save
In addition to what's shown in the below examples, if a glob pattern or valid filepath is passed, a stat
object will be added to the file
object as well.
var loader = require('load-templates');
// optionally pass an object to use for caching the views
var cache = {};
var views = loader(cache);
// object of views
views({
a: {path: 'a'},
b: {path: 'b'},
c: {path: 'c'}
});
// key-value pairs
views('d', {path: 'd'});
views('e', {path: 'e'});
views('f', {path: 'f'});
// glob pattern or file path, string or array
views('views/*.js'); // g, h, i
Results in:
{
a: {path: 'a'},
b: {path: 'b'},
c: {path: 'c'},
d: {path: 'd'},
e: {path: 'e'},
f: {path: 'f'},
g: {path: 'g'},
h: {path: 'h'},
i: {path: 'i'},
j: {path: 'j'}
}
Rename the key of each file
object.
Type: Function
Default: noop
Full filepath or whatever key is passed.
All options are also passed to globby.
Install dev dependencies:
$ npm i -d && npm test
As of version 0.9.1
Statements : 100% (81/81)
Branches : 100% (44/44)
Functions : 100% (13/13)
Lines : 100% (79/79)
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Jon Schlinkert
Copyright © 2014-2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on September 11, 2015.
FAQs
Load templates/views using globs, file paths, objects, arrays, or key-value pairs.
The npm package load-templates receives a total of 42,964 weekly downloads. As such, load-templates popularity was classified as popular.
We found that load-templates demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.