2.0.1 • Published 5 years ago

penthouse-cli v2.0.1

Weekly downloads
32
License
ISC
Repository
github
Last release
5 years ago

penthouse-cli

Cli command for penthouse

NPM version Build Status Downloads

About

This is a CLI package for penthouse

Usage

yarn add --dev penthouse-cli

(or npm install, if not using yarn)

Basic command

penthouse --url https://sometestwebsite.unicorn --css pub/static/some-css-file.css --width 900 --height 1890 --ouput pub/static/critical.css

Options

Some options are left out.

Only url and cssString are required - all other options are optional. Note that the html file found via url is expected to be styled; penthouse does not inject any styles, it just uses cssString (or css) to prune into critical css.

NameTypeDefaultDescription
urlstringAccessible url. Use file:/// protocol for local html files.
cssStringstringOriginal css to extract critical css from
cssstringPath to original css file on disk (if using instead of cssString)
widthinteger1300Width for critical viewport
heightinteger900Height for critical viewport
keepLargerMediaQueriesbooleanfalseKeep media queries even for width/height values larger than critical viewport.
timeoutinteger30000Ms; abort critical CSS generation after this time
pageLoadSkipTimeoutinteger0Ms; stop waiting for page load after this time (for sites when page load event is unreliable)
renderWaitTimeinteger100ms; wait time after page load before critical css extraction starts (also before "before" screenshot is taken, if used)
blockJSRequestsbooleantrueset to false to load JS (not recommended)
maxEmbeddedBase64Lengthinteger1000characters; strip out inline base64 encoded resources larger than this
maxElementsToCheckPerSelectorintegerundefinedCan be specified to limit nr of elements to inspect per css selector, reducing execution time.
userAgentstring'Penthouse Critical Path CSS Generator'specify which user agent string when loading the page
strictbooleanfalseMake Penthouse throw on errors parsing the original CSS. Legacy option, not recommended.
2.0.1

5 years ago

1.0.2

5 years ago

2.0.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago