pug-beautify
Simple Pug(Jade) Beautify
Last updated 9 years ago by vingorius .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install pug-beautify 
SYNC missed versions from official npm registry.

Pug(former jade) beautify

This tiny program is formatting a pug(former jade) template file.
For reusability, it's made as a module suggested by @Glaving001
https://github.com/vingorius/jade-beautify/issues/7

Installation

npm install pug-beautify

Test

npm test

Options

fill_tab : true/false,default true, fill whether tab or space.
omit_div : true/false,default false, whether omit 'div' tag.
tab_size : number, default 4, when 'fill_tab' is false, fill 'tab_size' spaces.

How to use

var output = pugBeautify(code);
var output = pugBeautify(code,{fill_tab:true,omit_div:false,tab_size:4});

Example code

var fs = require('fs');
var pugBeautify = require('pug-beautify');
var code = fs.readFileSync('sample.jade','utf8');
var option = {
    fill_tab: true,
    omit_div: false,
    tab_size: 4
};
try {
    var output = pugBeautify(code,option);
}catch(error){
    // Error occurred
}

Todo

Current Tags

  • 0.1.1                                ...           latest (9 years ago)

5 Versions

  • 0.1.1                                ...           9 years ago
  • 0.1.0                                ...           9 years ago
  • 0.0.3                                ...           9 years ago
  • 0.0.2                                ...           9 years ago
  • 0.0.1                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright 2013 - present © cnpmjs.org | Home |