New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

duibi

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

duibi

Check colour contrast accessibility of elements in a web pages

  • 0.2.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Duibi

Build Status npm version

Library and tool to check colour contrast accessibility of elements in a web pages.

CLI usage

Install globally as a tool:

npm install -g duibi

And use it!

Usage
  $ duibi <url> <container selector> <text selector>

Examples
  $ duibi 'https://www.klarna.com/se/' '.block-hero__title'

Library usage

Install it locally in your project:

npm install --save duibi

And call it directly:

import duibi from '..'

duibi({
  url: 'https://www.klarna.com/se/',
  containerSelector: '.block-hero__title',
}).then(result => console.log('done', result), error => console.log('error', error))

The result object contains:

{
  backgroundAverageColor: 'rgba(255,255,255,1)',
  foregroundColor: 'rgb(217, 177, 177)',
  ratio: 1.931200716492237,
  score: 'F',
  isAccessible: false,
  backgroundScreenshotPath: '/var/folders/gm/bnfrz1.1dw45.png',
  containerScreenshotPath: '/var/folders/gm/36100-1rbuk51.ftfb.png',
}

FAQs

Package last updated on 09 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc