How to use the jsrender.render function in jsrender

To help you get started, we’ve selected a few jsrender examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github byavv / mea2n / src / server / controllers / user.auth.controller.ts View on Github external
fs.readFile(path.join(__dirname, '../views/auth_success.html'), 'utf8', (err, data) => {
                        if (err) {
                            console.error(err)
                            return res.redirect(redirectURL || '/');
                        }
                        let jsrender = require("jsrender");
                        jsrender.templates({ tmpl: data });
                        var html = jsrender.render.tmpl({
                            identityData: JSON.stringify(identityData)
                        })
                        res.writeHead(200, { "content-type": 'text/html' });
                        res.write(html);
                        res.end();
                    });
                });
github byavv / mea2n / src / server / controllers / user.api.controller.ts View on Github external
fs.readFile(path.join(__dirname, '../views/reset_email.html'), 'utf8', (err, data) => {
                    if (err) {
                        done(err);
                    }
                    let jsrender = require("jsrender");
                    jsrender.templates({ tmpl: data });
                    var html = jsrender.render.tmpl({
                        username: user.username,
                        host: req.headers.host,
                        token: token
                    })
                    done(null, html, user);
                });
            },

jsrender

Best-of-breed templating in browser or on Node.js (with Express 4, Hapi and Browserify integration)

MIT
Latest version published 4 months ago

Package Health Score

68 / 100
Full package analysis