https://github.com/yankouskia/psi-local
Use PageSpeed Insights locally
https://github.com/yankouskia/psi-local
Last synced: 5 months ago
JSON representation
Use PageSpeed Insights locally
- Host: GitHub
- URL: https://github.com/yankouskia/psi-local
- Owner: yankouskia
- License: mit
- Created: 2017-08-30T21:09:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-30T21:52:51.000Z (over 7 years ago)
- Last Synced: 2024-11-10T23:19:07.942Z (5 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 18
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## psi-local
Use [PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights) locally!
#### Using
- `npm install psi-local --save-dev`
- run your application locally (e.g. http://localhost:3000)
- create `.js` file and require module:
```js
const psi = require('psi-local');psi(3000)
.then(data => {
// do something with results ...
});
```
- run `node .js`#### Additional
Module contains the only function and returns `Promise` for more the best usability. You can easily use ES2017 syntax for working with `psi-local` as this `promise` is never rejected. If some errors occur, it will return object `{ err: Error }`
```js
(async function() {
const port = 3000;
const stats = await psi(port);if (stats.err) return handleError(stats);
return handleResults(stats);
})()
```#### MIT License
Fill free to use and contribute