4 releases
0.1.9 | Mar 24, 2019 |
---|---|
0.0.3 | Mar 26, 2019 |
0.0.2 | Mar 26, 2019 |
0.0.1 | Mar 26, 2019 |
#8 in #jade
Used in resufancy
11KB
288 lines
pug (jade) templates
reimplemented in rust for performance reasons.
pug.js | pug-rs |
---|---|
780ms | 29ms |
usage:
$ cargo install pug
$ pug < thing.pug > thing.html
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();
}
module: {
rules: [
{
test: /\.pug$/,
use: [require.resolve('./pug_loader.js')]
},
Dependencies
~2.2–3MB
~60K SLoC