1.1.0 • Published 3 years ago

litic v1.1.0

Weekly downloads
14
License
ISC
Repository
github
Last release
3 years ago

Litic

JS library to perform technical SEO and best practices analysis to your projects.

Note: This tool functionality relies on Google Lighthouse. It's such a great tool to test your web projects!

Install

Just run the npm install command:

npm i litic -g

After the installation, you can use it via:

litic -u "https://example.com/test-url" -k "my keyword" -o "output.csv"

Tests

Litic currently analyses your website against 45 different tests, divided by category:

CategoryTest name
PerformanceHTTP/2
PerformanceServer Response Time
PerformanceLargest Contentful Paint
PerformanceCumulative Layout Shift
PerformanceFirst Contentful Paint
PerformanceTime to Interactive
PerformanceHTML Minification
PerformanceMinified CSS
PerformanceMinified JS
PerformanceOptimized caching strategy
PerformanceUses Text Compression
PerformanceReduced DOM Size
PerformanceLazy-load offscreen images
RobotsPage is crawlable
AccessibilityJump to Main Content
AccessibilityMatching HTML Language
AccessibilityColor Contrast
AccessibilityImage Alternative Text
AccessibilityAppropiate size for tap targets
AccessibilityFont size is greater than 12px
Best PracticesHTML is valid
Best PracticesConsole errors
Best Practices<!DOCTYPE html>
Best Practices<html> has lang attribute
Best PracticesApple Touch Icon
Best PracticesJavascript Links
Best PracticesEmpty Anchor Links
Meta-tags<meta charset="utf-8"> is used
Meta-tags<meta name="viewport"> is correctly used
Meta-tags<title> tag is present
Meta-tagsmetaname="description"
Meta-tagsCanonical URL is defined
Meta-tagsDocument has a valid hreflang
ContentHeading structure
ContentContent Width
ContentText Readability
ContentKeywords (Text Rank)
ContentBERT Score
SecurityNo plain text emails
SecurityHTTPS
SecurityHTTPS Redirection
SecurityExternal links use rel="noopener" or rel="noreferrer"
SecurityProtect against MIME Sniffing
SecurityProtect against Clickjacking
OtherDomain expiration

Each test comes with a description, and most of them will also offer you a link with more information.

Usage

To use Litic, you can just run an analysis with litic -u "https://your-url.com/". The results of this analysis will be printed on your console:

Litic screenshot

Additionally, you can also use other parameters, such as -o to specify the path where you want to store the results, or -k to specify a keyword to run content checks against.

Short nameLong nameDescriptionRequired
-u--urlURL to run the tests againstYes
-k--keywordKeyword to run content checks againstNo
-o--outputOutput path for a CSV file with the resultsNo

Running remote

If running under a low-resource environment, you can run the lighthouse analysis using Google PageSpeed Insights API. To do this, you just need to set the PAGESPEED_TOKEN environment variable to your API token, and Litic will use it to perform the remote analysis.

PAGESPEED_TOKEN={YOUR_TOKEN} litic -u "https://example.com"

Smart tests

There are a few tests that rely on Silver Diamond to execute. To use them, please register and set an environment variable named SD_KEY to your api key.

SD_KEY={API_KEY} litic -u "https://example.com"

Roadmap

There are a lot of tests I want to include in Litic, as well as making it possible to provide a list of URLs (or even an excel with tons of URLs) and run the tests against each one of them.

Contributions

Please, feel free to contribute to this repository, making pull requests or opening new issues.

License

Copyright © 2021 Raúl López and contributors

Licensed under the MIT license, see LICENSE for details.