1.18.1 • Published 4 months ago

fugu-api-data v1.18.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 months ago

Project Fugu 🐡 API Data

This repo contains raw data for Project Fugu 🐡 APIs. The data is available in two formats: pattern.js and pattern.mjs.

Data origin

The raw data in this repository comes from a Google spreadsheet that is published as a JSON file. The index.js script fetches this data, prettifies it, and saves it locally in a module and in a no-module variant.

Obtaining fresh data

You can trigger the data fetch process described above by running the start script:

npm start

Data usage

  • For the module version:

    import patterns from './patterns.mjs';
    
    console.log(patterns.WebBluetooth);
    /*
    {
      regEx: /navigator\.bluetooth\.requestDevice\s*\(/g,
      where: 'JavaScript',
      supported: (async () => 'bluetooth' in navigator)(),
      featureDetection: `(async () => 'bluetooth' in navigator)()`,
    }
    */
  • For the no-module version (for example to use it in a service worker):

    importScripts('patterns.js');
    console.log(patterns.WebBluetooth);
    /*
    {
      regEx: /navigator\.bluetooth\.requestDevice\s*\(/g,
      where: 'JavaScript',
      supported: (async () => 'bluetooth' in navigator)(),
      featureDetection: `(async () => 'bluetooth' in navigator)()`,
    }
    */

Data format

Each API is represented as an object with the following properties:

  • regEx: A regular expression that you can use to detect the API of interest in source code when you do static source code analysis.
  • where: The resource type where the regular expression needs to match in order to be valid. Either "JavaScript" or "Web App Manifest".
  • supported: A function that returns a promise that resolves with true, false, or undefined, dependent on whether the API is supported or not (undefined means no feature detection method exists).
  • featureDetection: The source code of the feature detection method, so you can use it in an eval() for example.

Depending projects

This data is used in the following projects:

License

Apache 2.0.

1.18.1

4 months ago

1.18.0

4 months ago

1.17.0

4 months ago

1.16.0

8 months ago

1.15.0

1 year ago

1.14.1

1 year ago

1.14.0

1 year ago

1.13.1

1 year ago

1.13.0

1 year ago

1.12.1

1 year ago

1.12.0

2 years ago

1.11.0

2 years ago

1.9.0

2 years ago

1.10.0

2 years ago

1.8.0

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.5.5

2 years ago

1.5.4

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago