Socket
Socket
Sign inDemoInstall

html-code-gen

Package Overview
Dependencies
0
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    html-code-gen

html-code-gen ========


Version published
Weekly downloads
222
increased by38.75%
Maintainers
2
Install size
101 kB
Created
Weekly downloads
 

Readme

Source

html-code-gen

Build Status NPM version Coverage Status Dependencies DevDependencies

html-code-gen is a HTML-code generator. It generates HTML code with given dom(-like) object.

Install

  • nodejs

      npm install html-code-gen
    
    var htmlCodeGen = require('html-code-gen');
    
  • browser (UMD bundle generated by browserify)

    • global

      <script src="html-code-gen/browser/html-code-gen.min.js"></script>
      
      var htmlCodeGen = window.htmlCodeGen;
      
    • AMD

      var htmlCodeGen = require('html-code-gen');
      

Usage

htmlCodeGen.print(dom, opt);
htmlCodeGen.printAsync(dom, opt).then(
	output => console.log(output)
);

Options

  • indent-size: size of indent

    default: 4

  • indent-char: char of indent ( space / tab )

    default: 'space'

  • max-char: max char num in one line (TODO)

    default: 80

  • no-format-tag: tags whose content should not be formatted

    default: spec.tagTypeMap.structural

  • no-format: no format

    default: false

  • inline-tag: tags whose content should be inline

    default: spec.tagTypeMap.inline

  • formatter: special formatters { tagName ( script / style ) : formater )

    default: {}

  • bool-attribute-value: hide value of boolean attribute or not ( 'remove' / 'preserve' )

    default: 'remove'

  • self-close: should void tags close themeselves with "/" ( 'close' / 'no-close' )

    default: 'no-close'

  • level: current level

    default: 0

Development

  • run test cases

      npm run test
    
  • build for browser

      npm run browser
    

FAQs

Last updated on 20 Feb 2017

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