brarkup

0.0.4 • Public • Published

Brarkup

Superseded by https://github.com/srcagency/brjade

A highly opinionated package for compiling html (from jade) in node and inlined using browserify.

var brarkup = require('brarkup');
 
brarkup.compile(__dirname + '/index.jade', function( err, html ){
    if (err)
        return console.error(err);
 
    // browser context?
    if (typeof document !== 'undefined' && document.body)
        document.body.innerHtml = html;
});

An optional argument before the callback is allowed for configuration. So far the only option is compress which will disable the pretty parameter of jade.

brarkup.compile(__dirname + '/index.jade', {
    compress: true,
}, cb);
var brarkup = require('brarkup');
var browserify = require('browserify');
 
browserify()
    .transform(brarkup, {
        compress: true,
    })
    .add('index.js')
    .bundle()
    .pipe(fs.createWriteStream('bundle.js'));

If you need anything else, like support for other languages than jade, or more flexibility, send a pull request.

You might be interested in Bryles.

Readme

Keywords

none

Package Sidebar

Install

npm i brarkup

Weekly Downloads

0

Version

0.0.4

License

MIT

Last publish

Collaborators

  • thomas-jensen