Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Wrap templates with layouts. Layouts can be nested and optionally use other layouts.
Wrap templates with layouts. Layouts can use/refer to other layouts, allowing them to be nested.
npm i layouts --save
var layouts = require('layouts');
Create a new instance of Layouts
, optionally passing the default
cache
and options
to use.
Example:
var Layouts = require('layouts');
var layout = new Layouts();
cache
{Object}: A template cache. See Layouts#set for object details.options
{Object}: Options to use.options.delims
{Array}: Template delimiters to use formatted as an array (['{{', '}}']
)options.tag
{String}: The tag name to use. Default is body
(e.g. {{ body }}
)Store a template on the cache by its name
, the layout
to use,
and the template's `content.
Example:
layout.set('a', 'b', '<h1>Foo</h1>\n{{body}}\n');
name
{String|Object}: If name
is a string, layout
and content
are required.data
{String|Object}: Pass a string defining the name of layout to use for the given template, or pass an object with a layout
property.content
{String}: The template "content", this will not be compiled or rendered.Get a cached template by name
.
Example:
layout.get('a');
//=> { layout: 'b', content: '<h1>Foo</h1>\n{{body}}\n' }
name
{String}return
{Object} The template object to return.Flatten nested layouts.
Example:
var page = layout.wrap('base');
var tmpl = _.template(page, context);
name
{String}: The layout to start with.return
{String} Resulting flattened layout.Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
This file was generated by verb-cli on July 28, 2014.
FAQs
Wraps templates with layouts. Layouts can use other layouts and be nested to any depth. This can be used 100% standalone to wrap any kind of file with banners, headers or footer content. Use for markdown, HTML, handlebars views, lo-dash templates, etc. La
The npm package layouts receives a total of 26,194 weekly downloads. As such, layouts popularity was classified as popular.
We found that layouts 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.