jade2js

0.1.0 • Public • Published

Compile jade into js functions served as one file

  $ jade2js path/to/templates path/to/result.js [--no-debug]
  

in html:

  <script src=/templates.js/>
  <script>
    render.*YourTemplateFilename*(variables)
  </script>

All your script tags would be cut from jade template and moved into result.js file as IIFE So you can use it to declare template specific code as:

  #myAwesomeSelector Hello World
  script
    - alert($('#myAwesomeSelector').val())

Jade generate a lot of debug information to help you debug your code. And it looks a bit messy, so for production use --no-debug or -D

Readme

Keywords

none

Package Sidebar

Install

npm i jade2js

Weekly Downloads

0

Version

0.1.0

License

ISC

Last publish

Collaborators

  • slava.ganzin