
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
layout-wrapper
Advanced tools
Wrap the contents in the layout template. gulpfriendly.
This module is designed to be used with gulp or bulbo.
NOTE: See also layout1, which is a more simple and flexible version of this module.
npm install layout-wrapper
This module works with gulp's file stream.
gulpfile.js:
const frontMatter = require('gulp-front-matter')
const wrapper = require('layout-wrapper')
gulp.src('src/pages/*.html')
.pipe(frontMatter())
.pipe(wrapper({
layout: 'src/layouts',
data: {name: 'world'},
engine: 'nunjucks'
}))
.pipe(gulp.dest('site/'))
Note You still need to install the template engine. (In the above case, you need to install nunjucks)
src/pages/sample.html:
---
title: Hello
layout: default
---
<p>Hello, {{ name }}!</p>
src/layouts/default.nunjucks:
<html>
<head>
<title>{{ file.frontMatter.title }}</title>
</head>
<body>
{{ contents }}
</body>
</html>
The above settings outputs the following html into the path site/sample.html:
<html>
<head>
<title>Hello</title>
</head>
<body>
<p>Hello, world!</p>
</body>
</html>
bulbofile.js:
const frontMatter = require('gulp-front-matter')
const wrapper = require('layout-wrapper')
asset('src/pages/*.html')
.pipe(frontMatter())
.pipe(wrapper({
layout: 'src/layouts',
data: {name: 'world'},
engine: 'nunjucks'
}))
const wrapper = require('layout-wrapper')
lodash. Please see the document of consolidate.js for what's available here.frontMatter.'layout'.default.'.' + engine name e.g. .lodash .ejs .nunjucks etc.This returns the transform stream from vinyl to vinyl. This transforms
You can also use alias methods.
gulp.src('src/pages/*.html')
.pipe(frontMatter())
.pipe(wrapper.nunjucks({
layout: 'src/layouts',
data: {name: 'world'}
}))
.pipe(gulp.dest('site/'))
The above is equivalent of engine: 'nunjucks' call of wrapper.
MIT
FAQs
Wrap the contents in the layout template. gulpfriendly.
We found that layout-wrapper 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 researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.