npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

chrome-api-definitions

v1.0.0

Published

Consolidated definitions for Chrome Platform APIs

Downloads

203

Readme

chrome-api-definitions

Definition generator for Chrome Platform APIs.

Uses the Chromium extension definitions (both common and chrome definitions) for the Chrome Platform APIs and constructs a manifest of all available platform APIs for extensions.

While the original manifests defines permissions, allowable contexts, and other metadata describing the namespace (sometimes a specific method inside a namespace also has this meta), the full definition of the available methods, types and objects exposed in the API is defined by either JSON or (Blink's version of) WebIDL. This constructs a structure listing all available APIs with their appropriate meta from the manifest, as well as the available entities inside of that namespace.

Parsing the Blink WebIDL here is a horrible hack to get it similar to the APIs with JSON definitions, but gets us close enough.

Output

Pretty much an array of all specified APIs (by filter config), using the JSON definitions from Chromium if they exist, or otherwise using the WebIDL version for something that attempts to get pretty close.

Root APIs (like alarms or devtools.inspectedWindow) also now have properties of permissions and content_script, if these were defined in the Chromium manifest, for example:

{
  "namespace": "storage",
  "dependencies": ["permission:storage"],
  "content_script": true
}

When defined in the manifest, an API's methods can also have this additional information (only runtime and extensions API have individual methods in the manifest, AFAIK).

{
  "namespace": "runtime",
  ...
  "functions": [{
    "name": "sendMessage",
    "content_script": true
  }, {
  ...
  }]
}

View built output of stable APIs for the most illumination.

API

getDefinitions(options)

Returns the definition for the specified APIs as an object. Options:

  • filter - provide an array of namespaces to filter by, or use a string to specify a preset in api-names.json. Defaults to the preset "stable".
  • apiRoot - path to the directory containing both common and chrome APIs. Uses the directory in ./api by default. Not tested.

saveDefinitions(options)

Same as getDefinitions() except it just saves to disk. Takes the same options as getDefinitions(), plus:

  • dest - path of where the definition should be saved.

License

For chrome-api-defintions: MIT License, Copyright (c) 2015 Jordan Santell

For API manifests from Chromium source: Modified BSD License, Copyright 2014 The Chromium Authors. All rights reserved.