james-compile
Compiler plugin for james.js
Last updated 8 years ago by bebraw .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install james-compile 
SYNC missed versions from official npm registry.

james-compile - A compiler plugin for james.js

Generic template compiler for James.js. The compiler you use should provide a compile method that returns a function that may be used to render a context. Ie. jade.compile()() is such a function. In case the templating engine you wish to use does not implement this scheme, consider implementing an adapter.

var james   = require('james'),
    compile = require('james-compile'),
    jade    = require('jade');

james.task('jade', function() {
    james.list('src/**/*.jade').forEach(function(file) {
        james.read(file)
            .transform(compile({
                compiler: jade,
                filename: file,
                context: {
                    title: 'demo'
                }
            }))
            .write(process.stdout);
        });
    });

License

james-compile is available under MIT. See LICENSE for more details.

Current Tags

  • 0.3.0                                ...           latest (8 years ago)

4 Versions

  • 0.3.0                                ...           8 years ago
  • 0.2.2                                ...           8 years ago
  • 0.2.1                                ...           8 years ago
  • 0.2.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |