Pug(former jade) beautify
This tiny program format a pug(former jade) template file. For reusability, it's made as a module suggested by @Glavin001, @MaraniMatias added some functions.
Installation
npm install pug_formatter
Global
npm install -g pug_formatter
Test
npm run test
Options
- fill_tab - boolean, fill whether tab or space, default true.
- omit_div - boolean, whether omit 'div' tag, default false.
- tab_size - number, when 'fill_tab' is false, fill 'tab_size' spaces, default 4.
- separator_space - boolean, When 'separator_space' is true, the attribute separator is comma, default true.
- omit_empty_lines - When 'separator_space' is false, delete line blank, default true.
How to use
NodeJS
var output = ;
var output = ;
Shell
pugformat -hpugformat -o '{"tab_size":4}' ./index.pug
Example code
var fs = ;var pugBeautify = ;var code = fs;var option = fill_tab: true omit_div: false tab_size: 4 separator_space: true omit_empty_lines : false;try var output = ;catcherror // Error occurred