Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

doiuse

Package Overview
Dependencies
Maintainers
4
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

doiuse

Lint CSS for browser support against caniuse database

  • 6.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
313K
decreased by-4.22%
Maintainers
4
Weekly downloads
 
Created

What is doiuse?

The doiuse npm package is a tool for checking your CSS against browser support. It helps developers ensure that their CSS is compatible with the browsers they intend to support by identifying unsupported or partially supported CSS features.

What are doiuse's main functionalities?

Check CSS for browser support

This feature allows you to check your CSS code against a list of browsers to see if any features are not supported. The code sample demonstrates how to use doiuse with PostCSS to process a CSS string and log any warnings about unsupported features.

const doiuse = require('doiuse');
const postcss = require('postcss');

const css = 'a { display: flex; }';

postcss([doiuse({ browsers: ['> 1%', 'last 2 versions'] })])
  .process(css)
  .then(result => {
    result.warnings().forEach(warn => {
      console.warn(warn.toString());
    });
  });

Custom browser support configuration

This feature allows you to specify custom browser support configurations. The code sample shows how to configure doiuse to check CSS against Internet Explorer 10 and the last two versions of all other browsers.

const doiuse = require('doiuse');
const postcss = require('postcss');

const css = 'a { display: grid; }';

postcss([doiuse({ browsers: ['ie >= 10', 'last 2 versions'] })])
  .process(css)
  .then(result => {
    result.warnings().forEach(warn => {
      console.warn(warn.toString());
    });
  });

Other packages similar to doiuse

Keywords

FAQs

Package last updated on 21 Oct 2024

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