2 releases

0.2.1 May 26, 2024
0.2.0 May 20, 2024

#9 in #jade

Download history 136/week @ 2024-08-05 7/week @ 2024-08-12 28/week @ 2024-08-19 40/week @ 2024-09-02 9/week @ 2024-09-09 19/week @ 2024-09-23 24/week @ 2024-10-14 45/week @ 2024-10-21 33/week @ 2024-10-28 22/week @ 2024-11-04

124 downloads per month
Used in 2 crates (via i18n_js)

MIT license

18KB
461 lines

pug-rs

crates.io

A port of pug to Rust.

This is a maintained fork of the original code by github.com/aep.

CLI usage

$ cargo install pug
$ pug < thing.pug > thing.html

Using with webpack

pug_loader.js:

const spawnSync = require('child_process').spawnSync;
module.exports = function(source) {
  var proc = spawnSync("pug", {
    input: source
  });
  if (proc.status != 0) {
    throw proc.error;
  }
  return proc.stdout.toString();
}

webpack.config.js

  module: {
    rules: [
      {
        test: /\.pug$/,
        use: [require.resolve('./pug_loader.js')]
      },

Dependencies

~2–3MB
~58K SLoC