Socket
Socket
Sign inDemoInstall

@johnsoncodehk/pug-beautify

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @johnsoncodehk/pug-beautify

Simple Pug(Jade) Beautify


Version published
Weekly downloads
30K
decreased by-5%
Maintainers
1
Install size
15.4 kB
Created
Weekly downloads
 

Readme

Source

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. Please refer this issue.

Installation

npm install pug-beautify

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

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

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,
    separator_space: true
};
try {
    var output = pugBeautify(code,option);
}catch(error){
    // Error occurred
}

Todo

Keywords

FAQs

Last updated on 11 Mar 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc