npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-wrap-layout

v0.3.0

Published

A gulp plugin to wrap the stream contents with a lodash template.

Downloads

10

Readme

gulp-wrap-layout NPM version

A gulp plugin to wrap the stream contents with an ejs template.

Usage

First, install gulp-wrap-layout as a development dependency:

npm install --save-dev gulp-wrap-layout

Then, add it to your gulpfile.js:

Wrap the contents with an inline template:

var wrap = require("gulp-wrap-layout");

gulp.src("./src/*.json")
	.pipe(wrap('angular.module(\'text\', []).value(<%= contents %>);'))
	.pipe(gulp.dest("./dist"));

Wrap the contents with a template from file:

var wrap = require("gulp-wrap-layout");

gulp.src("./src/*.json")
	.pipe(wrap({ src: 'path/to/template.txt'}))
	.pipe(gulp.dest("./dist"));

Provide additional data and options for template processing:

var wrap = require("gulp-wrap-layout");

gulp.src("./src/*.json")
	.pipe(wrap('BEFORE <%= contents %> <%= data.someVar %> AFTER', { someVar: 'someVal'}, { variable: 'data' }))
	.pipe(gulp.dest("./dist"));

This gulp plugin wraps the stream contents in a template. If you want the stream contents to be the templates use the gulp-template plugin.

Template

The stream contents will be available in the template using the contents key. Properties from the vinyl file will be available in the template under the file object and are local to that stream. User supplied data values will always take precedence over namespace clashes with the file properties.

API

wrap(template[,data][,options])

template

Type: String or Object

The template to used. When a String then it will be used as the template. When an Object then the template will be loaded from file.

template.src

Type: String

The file location of the template.

data

Type: Object

The data object that is passed on to the ejs template call.

options

Type: Object

The options object that is passed on to the ejs template call.

wrap.ejs

Access the ejs object directly

License

MIT License