Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    jade-rendererpublic

    Build Status

    Render batches of jade templates, with custom options, data and locals.

    Install

    npm install jade-renderer

    Usage

    var render = require('jade-renderer')

    render(pages, options, cb)

    • pages an array of 'pages' to render. 'pages' look like this:
    { template: 'path/to/template'
    , data:
      { text: 'some arbitrary data'
      , more: 'to pass to the template'
      , fn: function () {
          return 'may contain any js, including functions'
        }
      }
    }
    • options is an options hash
      • src the source directory, defaults to PWD
      • dest the destination directory, defaults to PWD
      • locals locals to be passed to all views that are rendered (useful for view helpers)
    • cb is the callback function (err) {} (err is null if ok)

    Eg:

    render(
        [ { template: 'index', data: { title: 'Index'} }
        , { template: 'about', data: { title: 'About'} }
        ]
      , { src: __dirname
        , dest: __dirname + '/html/'
        }
      , function (err) {
        if (err) throw err
        console.log('done!')
      })

    Keywords

    none

    install

    npm i jade-renderer

    Downloadsweekly downloads

    1

    version

    0.0.4

    license

    none

    last publish

    collaborators

    • avatar