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

webext-schema

Package Overview
Dependencies
Maintainers
1
Versions
190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webext-schema

WebExtensions schemas fetched from hg.mozilla.org

  • 0.4.0
  • dev
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20
decreased by-93.44%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status dependencies Status devDependencies Status

webext-schema

WebExtensions schemas fetched from hg.mozilla.org

WIP Not published to npm yet.

Install

npm i webext-schema

Usage

const {Schema} = require("webext-schema");

const schema = new Schema();

schema.channel

Schemas for "release", "beta", "central" are available. Release channel defaults to "release".

If you want to specify a particular channel, pass one of the three channels as an argument when creating the instance.

const schema = new Schema("beta");

Or you can set it afterwards.

const schema = new Schema();
schema.channel = "beta";

schema.arrange(opt)

  • @param {Object} opt - options
  • @param {string} opt.name - application name

Get the arranged schema for the specific application.

const schema = (new Schema()).arrange({name: "sinon-chrome"});
// [{namespace: "alarms", functions: [{...}], ...}];

schema.get(name)

  • @param {string} name - API name or file name

Get the schema for a specific API. Argument can be either an API name or a file name. Returns an array.

const schema = (new Schema()).get("browserAction");
// [{namespace: "browserAction", events: [...], ...}]
const schema = (new Schema()).get("browser_action.json");
// [{namespace: "browserAction", events: [...], ...}]

schema.getAll()

Get all schemas as a single object. Returns an object containing all schemas. Note that the key of the object is the file name and the value is the schema.

const schema = (new Schema()).getAll();
// {"alarms.json": [{...}], "bookmarks.json": [{...}], ...}

schema.list()

Get the list of schema files. Returns an array.

const list = (new Schema()).list();
// ["alarms.json", "bookmarks.json", ...]

FAQs

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

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