jade-compiler.js 301 B

1234567891011121314
  1. var ensureRequire = require('../ensure-require.js')
  2. const throwError = require('../throw-error')
  3. module.exports = function (raw) {
  4. var html
  5. ensureRequire('jade', 'jade')
  6. var jade = require('jade')
  7. try {
  8. html = jade.compile(raw)()
  9. } catch (err) {
  10. throwError(err)
  11. }
  12. return html
  13. }