Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

hbs-json

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hbs-json

Handlebars helper for JSON.stringify.

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
287
2.14%
Maintainers
3
Weekly downloads
 
Created
Source

hbs-json

Handlebars helper for JSON.stringify.

Installation

$ npm install hbs-json

Example

var json = require('hbs-json');
var hbs = require('hbs');

hbs.registerHelper('json', json);

app.get('/', function (req, res, next) {
  res.render('index.html', { user: req.context.user });
});
 <script>
    window.user = {{{ json user }}}
  </script>

API

json obj [escaped]

A handlebars helper for JSON.stringify. By default, will escape html characters so that you may use handlebars to render values to the template.

License

WWWWWW||WWWWWW
 W W W||W W W
      ||
    ( OO )__________
     /  |           \
    /o o|    MIT     \
    \___/||_||__||_|| *
         || ||  || ||
        _||_|| _||_||
       (__|__|(__|__|

Keywords

handlebars

FAQs

Package last updated on 01 Apr 2014

Did you know?

Socket

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