Skip to content
Extract all CSS from a webpage, packaged as a Now V2 Lambda
Branch: master
Clone or download
Latest commit bbe7f28 Mar 24, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public add possibility to extract css from an actual CSS file url Mar 5, 2019
.gitignore init commit Feb 14, 2019
.nowignore
dev.js
extract-css.js mv extract-css to separate file Mar 23, 2019
index.js mv extract-css to separate file Mar 23, 2019
now.json
package-lock.json add possibility to extract css from an actual CSS file url Mar 5, 2019
package.json add possibility to extract css from an actual CSS file url Mar 5, 2019
readme.md add project wallace badge Mar 8, 2019

readme.md

Extract CSS

Get all the CSS from a webpage.

Platform: Now V2 Project: Wallace

The problem

The folks from CSS Stats have created get-css, a package to get all the CSS from a given webpage. One downside, however, is that it only works for server side rendered applications.

The solution

This package uses an actual browser under the hood to get all the CSS and exposes an HTTP endpoint that accepts a url to get the CSS from.

Local testing

I have no idea how local testing for Now is supposed to work, so I created a tiny HTTP server in dev.js that calls the actual function that gets deployed. Run ENV=dev npm run dev to run a local version of the function for local testing.

Deployment

Using Now: now.

Credits

You can’t perform that action at this time.