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

@woltapp/browserbug-core

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@woltapp/browserbug-core

Parser and core comparison utilities for the browserbug syntax.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
39
decreased by-69.53%
Maintainers
0
Weekly downloads
 
Created
Source

@woltapp/browserbug-core

Parser and core comparison utilities for the browserbug syntax.

This is useful if you want to recreate the ESLint and Stylelint rules, but in a different linter.

Installation

npm install @woltapp/browserbug-core

Usage

import {
  parseBrowserbug,
  getBrowserSupportStatus,
  type BrowserbugDescriptor,
} from '@woltapp/browserbug-core';
import browserslist from 'browserslist',

// Read targets from environment
const targets = browserslist()

const parseResult = parseBrowserbug(
  '@browserbug chrome equal 120 -- Some comment',
  browserslist.data // used to validate the list and available versions of browsers
);

if (!parseResult.success) {
  // Do something with the error here :)
  console.error(parseResult.error.message);
}

// Do something with data here
for (const descriptor of parseResult.data) {
  const supportStatus = getBrowserSupportStatus(data)
}

About the grammar

The grammar is currently written with Ohm. Earlier versions of the grammar were built with sticky RegExp and a stack, but that seemed a bit ad-hoc.

If you have a compelling case for alternatives, including speed and quality of error messages, we would love to hear them!

Keywords

FAQs

Package last updated on 29 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