w-data-html-minify
v1.0.7
Published
A tool for minify html.
Downloads
121
Maintainers
Readme
w-data-html-minify
A tool for minify html.
Documentation
To view documentation or get support, visit docs.
Installation
Using npm(ES6 module):
Note: w-data-html-minify is mainly dependent on
html-minifier
.
npm i w-data-html-minify
Example:
Link: [dev source code]
import wdhm from './src/WDataHtmlMinify.mjs'
// import wdhm from './dist/w-data-html-minify.umd.js'
// import wdhm from 'w-data-html-minify'
let hin = `
<html>
<head></head>
<body>abc</body>
</html>
`
let hout = wdhm(hin)
console.log(hout)
// => <html><head></head><body>abc</body></html>
In a browser(UMD module):
Note: w-data-html-minify does not dependent on any package.
[Necessary] Add script for w-data-html-minify.
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/w-data-html-minify.umd.js"></script>
minify html: ex-html-minify.html [source code]
let wdhm = window['w-data-html-minify']
// console.log(wdhm)
let hin = `
<html>
<head></head>
<body>abc</body>
</html>
`
let hout = wdhm(hin)
console.log(hout)
// => <html><head></head><body>abc</body></html>