New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@rosetta/compat

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rosetta/compat

Rosetta Project's Browser Compatibility Package

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

@rosetta/compat

Rosetta Project's browser compatibility package.

Note: This package is in the development phase. Expect most releases to contain breaking changes.

Install

Using npm:

npm install @rosetta/compat

Using yarn:

yarn add @rosetta/compat

Usage

import compat from "@rosetta/compat"

// Each of these will return a BrowserCompatibilityObject
compat.check("./main.css")
compat.check("./main.html")
compat.check("./main.abc", { type: "CSS" })
compat.checkCSS("body { background: red; }")
compat.checkHTML('<input type="button">Hello World!</input>')

API

compat.check(filename, options?)

Reads the contents of a file and runs either checkCSS or checkHTML depending on the file extension. If file extension cannot be determined, an options object can be passed in.

options {
  type: "CSS" | "HTML"
}

compat.checkCSS(input)

Parses the contents on input and returns a BrowserCompatibilityObject dictating the browser versions that can run the css.

compat.checkHTML(input)

Parses the contents on input and returns a BrowserCompatibilityObject dictating the browser versions that can run the html.

BrowserCompatibilityObject

BrowserCompatibilityObject {
  desktop: {
    chrome: VersionsObject,
    firefox: VersionsObject,
    ie: VersionsObject,
    edge: VersionsObject,
    safari: VersionsObject,
    opera: VersionsObject
  },
  mobile: {
    chrome: VersionsObject,
    firefox: VersionsObject,
    safari: VersionsObject,
    edge: VersionsObject,
    opera: VersionsObject
  }
}

VersionsObject {
  support: "SUPPORTED" | "PARTIAL SUPPORT" | "NONE" | "UNKNOWN",
  start: string | null,
  end: string | null
}

Keywords

rosetta

FAQs

Package last updated on 03 Jan 2019

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