Site audit for your site from terminal
Siteaudit will analyze your site and generate audit for:
You can use siteaudit from your terminal using the npm package and run it as a binary
npm -g i siteaudit
siteaudit --url https://canellariccardo.itor you can use siteadit inside your node application
const SiteAudit = require('siteaudit/lib/node');
SiteAudit.start('https://canellariccardo.it', {
pagespeed: true,
lighthouse: false,
a11y: true,
outputFolder: '/output',
customAppenName: `-${Date.now()}`,
});You can also use the docker image to generate the reports
docker run -t \
-v "$(pwd)/.testoutput":"/app/output" \
thecreazy/siteaudit:latest \
--url https://canellariccardo.it \
--headlessdocker run -t \
-v "$(pwd)/.testoutput":"/app/output" \
-v "$(pwd)/.siteaudit.json":"/.siteaudit.json"
thecreazy/siteaudit:latest \
--url https://canellariccardo.it \
--no-lighthouse \
--config /.siteaudit.json \
--headless--url specify the base url to test--output specify the output directory (where your assets will be generated)--config specify a JSON file containing an extension to the configuration--no-pagespeed no pagespeed audit will be generated--no-lighthouse no lighthouse audit will be generated--no-a11y start without a11y audit--headless use chrome headlessYou can also use environments for passing the options
SITEAUDIT_NOLIGHTHOUSE no lighthouse audit will be generatedSITEAUDIT_NOPAGESPEED no pagespeed audit will be generatedSITEAUDIT_CONFIG specify a JSON file containing an extension to the configurationSITEAUDIT_URL pass the url for running the auditSITEAUDIT_A11Y no a11y audit will be generatedSITEAUDIT_HEADLESS use chrome headlessSITEAUDIT_USINGENV force the use of the environmentsIf you pass to siteaudit an additional JSON file, it will be merged with initial config.
siteaudit --url https://canellariccardo.it --config ./config.jsonExample:
{
"pagespeed": {
"pages": ["/", "/404"]
}
}You can also pass a custom config json, there are some examples:
{
"pagespeed":{
"strategy" : [ "mobile", "desktop"], // Strategy to use when analyzing the page. this is the base settings, you can only use mobile | desktop
"locale": "en_US", // Locale results should be generated in.
"threshold": "70", // Threshold score to pass the PageSpeed test. Useful for setting a performance budget.
"pages": ["/"]. //Array of relative pages to analyze, default is only / (please, use relative path)
}
}For full list of settings options see here.
…You can also use siteaudit in your gitlabci.yml
stages:
- audit
audit:
image:
name: thecreazy/siteaudit:latest
entrypoint: ['']
stage: audit
variables:
SITEAUDIT_URL: 'https://canellaricardo.it'
script:
- echo "started siteaudit"
- /usr/local/bin/siteaudit --url=${SITEAUDIT_URL} --headless
artifacts:
paths:
- outputsiteaudit will generate this output:
lighthouse-audit.html: contains the classic html result of lighthousepagespeed-audit.md: a markdown format result of the pagespeed apia11y-audit.md: a markdown format result of the a11y apiMIT
No open issues yet, or sync has not completed.