Jade plugin for Babel
JavaScript HTML
Latest commit a69396f Apr 2, 2015 @kittens kittens 5.0.0
Permalink
Failed to load latest commit information.
test Fix test Apr 2, 2015
.gitignore Initial commit Aug 27, 2014
LICENSE Initial commit Aug 27, 2014
README.md update to new babel name Feb 15, 2015
index.js update to new babel name Feb 15, 2015
package.json 5.0.0 Apr 2, 2015

README.md

Jade-babel

This is a simple module which adds a babel (ES6 to ES5) filter to jade.

Installation

$ npm install jade-babel

Usage

var jade = require('jade');
var babel = require('jade-babel');

jade.filters.babel = babel({});

OR

var jade = require('jade');
var babel = require('jade-babel');

jade = babel({}, jade);

Now you can use ES6 in your jade templates as following.

script
    :babel
        console.log('Hello World !!!');
        class Person{
            constructor(name){
                this.name = name;
            }
            sayName(){
                console.log(`Hello, my name is ${this.name}`);
            }
        }
        var pers = new Person('Apoxx');
        pers.sayName();