Socket
Socket
Sign inDemoInstall

injectify-include

Package Overview
Dependencies
10
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    injectify-include

Include helper for handlebars and browserify


Version published
Maintainers
1
Created

Readme

Source

Injectify include helper Build Status

Additional helper for handlebars, include template into template. Work similar to partials but with browserify.

Install

npm install --save-dev injectify injectify-include

Usage

Configure gulp:

    var gulp = require("gulp"),
        browserify = require("browserify"),
        source = require("vinyl-source-stream"),
         
    require("injectify-include/inject");
        
    gulp.task('js', function () {
        var bundleStream = browserify('./src/index.js')
            .transform(require("injectify"))
            .bundle();

        return bundleStream
            .pipe(source('index.js'))
            .pipe(gulp.dest('dist'));
    });

In file ./src/index.js require injectify include helper:

require("injectify-include");

Now you can use include helper in your templates:

<h1>Example</h1>

<p>{{include "./other-template.hbs"}}</p>

<p>You also may pass params to template</p>

<p>{{include "./other-template.hbs" value=123 id=userId}}</p>

include helper works like original browserify require. You can require modules relative to template file or node_modules directory.

Changelog

v2.0

  • Handlebars 3.0
  • Injectify 2.0

FAQs

Last updated on 05 Aug 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc