@types/html-minifier
- Version 4.0.5
- Published
- 9.87 kB
- 3 dependencies
- MIT license
Install
npm i @types/html-minifier
yarn add @types/html-minifier
pnpm add @types/html-minifier
Overview
TypeScript definitions for html-minifier
Index
Functions
Interfaces
Options
- caseSensitive
- collapseBooleanAttributes
- collapseInlineTagWhitespace
- collapseWhitespace
- conservativeCollapse
- continueOnParseError
- customAttrAssign
- customAttrCollapse
- customAttrSurround
- customEventAttributes
- decodeEntities
- html5
- ignoreCustomComments
- ignoreCustomFragments
- includeAutoGeneratedTags
- keepClosingSlash
- maxLineLength
- minifyCSS
- minifyJS
- minifyURLs
- preserveLineBreaks
- preventAttributesEscaping
- processConditionalComments
- processScripts
- quoteCharacter
- removeAttributeQuotes
- removeComments
- removeEmptyAttributes
- removeEmptyElements
- removeOptionalTags
- removeRedundantAttributes
- removeScriptTypeAttributes
- removeStyleLinkTypeAttributes
- removeTagWhitespace
- sortAttributes
- sortClassName
- trimCustomFragments
- useShortDoctype
Functions
function minify
minify: (text: string, options?: Options) => string;
Interfaces
interface Options
interface Options {}
property caseSensitive
caseSensitive?: boolean | undefined;
property collapseBooleanAttributes
collapseBooleanAttributes?: boolean | undefined;
property collapseInlineTagWhitespace
collapseInlineTagWhitespace?: boolean | undefined;
property collapseWhitespace
collapseWhitespace?: boolean | undefined;
Collapse white space that contributes to text nodes in a document tree
See Also
http://perfectionkills.com/experimenting-with-html-minifier/#collapse_whitespace
property conservativeCollapse
conservativeCollapse?: boolean | undefined;
property continueOnParseError
continueOnParseError?: boolean | undefined;
Handle parse errors instead of aborting false
property customAttrAssign
customAttrAssign?: RegExp[] | undefined;
property customAttrCollapse
customAttrCollapse?: RegExp | undefined;
property customAttrSurround
customAttrSurround?: RegExp[] | undefined;
property customEventAttributes
customEventAttributes?: RegExp[] | undefined;
property decodeEntities
decodeEntities?: boolean | undefined;
property html5
html5?: boolean | undefined;
property ignoreCustomComments
ignoreCustomComments?: RegExp[] | undefined;
property ignoreCustomFragments
ignoreCustomFragments?: RegExp[] | undefined;
property includeAutoGeneratedTags
includeAutoGeneratedTags?: boolean | undefined;
property keepClosingSlash
keepClosingSlash?: boolean | undefined;
property maxLineLength
maxLineLength?: number | undefined;
property minifyCSS
minifyCSS?: boolean | CleanCSS.Options | ((text: string) => string) | undefined;
property minifyJS
minifyJS?: | boolean | UglifyJS.MinifyOptions | ((text: string, inline: boolean) => string) | undefined;
property minifyURLs
minifyURLs?: | boolean | RelateUrl.Options | ((text: string) => string) | undefined;
property preserveLineBreaks
preserveLineBreaks?: boolean | undefined;
property preventAttributesEscaping
preventAttributesEscaping?: boolean | undefined;
property processConditionalComments
processConditionalComments?: boolean | undefined;
property processScripts
processScripts?: string[] | undefined;
property quoteCharacter
quoteCharacter?: string | undefined;
property removeAttributeQuotes
removeAttributeQuotes?: boolean | undefined;
Remove quotes around attributes when possible
See Also
http://perfectionkills.com/experimenting-with-html-minifier/#remove_attribute_quotes
property removeComments
removeComments?: boolean | undefined;
Strip HTML comments
See Also
http://perfectionkills.com/experimenting-with-html-minifier/#remove_comments
property removeEmptyAttributes
removeEmptyAttributes?: | boolean | ((attrName: string, tag: string) => boolean) | undefined;
Remove all attributes with whitespace-only values
See Also
http://perfectionkills.com/experimenting-with-html-minifier/#remove_empty_or_blank_attributes
property removeEmptyElements
removeEmptyElements?: boolean | undefined;
Remove all elements with empty contents
See Also
http://perfectionkills.com/experimenting-with-html-minifier/#remove_empty_elements
property removeOptionalTags
removeOptionalTags?: boolean | undefined;
Remove optional tags
See Also
http://perfectionkills.com/experimenting-with-html-minifier/#remove_optional_tags
property removeRedundantAttributes
removeRedundantAttributes?: boolean | undefined;
Remove attributes when value matches default.
See Also
http://perfectionkills.com/experimenting-with-html-minifier/#remove_redundant_attributes
property removeScriptTypeAttributes
removeScriptTypeAttributes?: boolean | undefined;
property removeStyleLinkTypeAttributes
removeStyleLinkTypeAttributes?: boolean | undefined;
property removeTagWhitespace
removeTagWhitespace?: boolean | undefined;
property sortAttributes
sortAttributes?: boolean | undefined;
Sort attributes by frequency
Minifier options like sortAttributes and sortClassName won't impact the plain-text size of the output. However, they form long repetitive chains of characters that should improve compression ratio of gzip used in HTTP compression.
See Also
https://github.com/kangax/html-minifier#sorting-attributes--style-classes
property sortClassName
sortClassName?: boolean | undefined;
Sort style classes by frequency
Minifier options like sortAttributes and sortClassName won't impact the plain-text size of the output. However, they form long repetitive chains of characters that should improve compression ratio of gzip used in HTTP compression.
See Also
https://github.com/kangax/html-minifier#sorting-attributes--style-classes
property trimCustomFragments
trimCustomFragments?: boolean | undefined;
property useShortDoctype
useShortDoctype?: boolean | undefined;
Replaces the doctype with the short (HTML5) doctype
See Also
http://perfectionkills.com/experimenting-with-html-minifier/#use_short_doctype
Package Files (1)
Dependencies (3)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/html-minifier
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/html-minifier)
- HTML<a href="https://www.jsdocs.io/package/@types/html-minifier"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3793 ms. - Missing or incorrect documentation? Open an issue for this package.