Socket
Socket
Sign inDemoInstall

doiuse

Package Overview
Dependencies
Maintainers
1
Versions
54
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.


Version published
Weekly downloads
312K
increased by0.71%
Maintainers
1
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 01 Feb 2016

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc