Socket
Book a DemoInstallSign in
Socket

webext-schema

Package Overview
Dependencies
Maintainers
1
Versions
197
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.6.11
Source
npmnpm
Version published
Weekly downloads
700
8.36%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status dependencies Status devDependencies Status npm version

webext-schema

WebExtensions schemas fetched from hg.mozilla.org

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 "beta".

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("central");

Or you can set it afterwards.

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

schema.arrange(opt)

  • @param {Object} opt - options
  • @param {string} opt.name - application name
  • @returns {*} - arranged schema

Get the arranged schema for the specific application.

Supported applications:

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

schema.get(name)

  • @param {string} name - API name or file name
  • @returns {?Array} - schema

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

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

schema.getAll()

  • @returns {Object} - all schemas

Get all schemas as a single object. 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()

  • @returns {Array} - file names

Get the list of schema files.

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

FAQs

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.