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

openapi-directory

v1.3.6

Published

Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS

Downloads

10,729

Readme

An OpenAPI Directory for JS Build Status npm version

Part of HTTP Toolkit: powerful tools for building, testing & debugging HTTP(S)

This repo builds & bundles the OpenAPI Directory, so you can easily find, require and use any OpenAPI spec from the directory in your JS projects.

It provides files that can be individually required or remotely downloaded (via https://unpkg.com/openapi-directory/) for every API in the collection, and an index to quickly find the relevant OpenAPI spec for a given URL.

All specs are:

  • Pre-parsed and exposed as JavaScript objects (not YAML strings).
  • Converted to OpenAPI v3.
  • Pre-bundled with all external $refs.

That means you can import them, and immediately & consistently start using them.

How to use it

First up, install it with:

npm install openapi-directory

All OpenAPI specs can be now required with:

const spec = require('openapi-directory/api/<spec-id>.json');

(or read from https://unpkg.com/openapi-directory/api/<spec-id>.json)

The easiest way to obtain a spec id is to use the index. You can look up a URL in the index with:

const { findApi } = require('openapi-directory');

findApi('wikimedia.org/api/rest_v1/feed/availability');

findApi takes a URL (host and path, without the protocol) within any API, and will return either:

  • Undefined, if there is no matching APIs.
  • A string spec id, if there is exactly one API that's relevant to that URL.
  • A list of spec ids, in rare cases where multiple specs may cover the same URL.

Alternatively if you know in advance which spec you want you can require it directly. The id for every spec in the directory is made up of the provider name, followed by a slash and the service name if a service name exists. Some example ids:

  • xkcd.com (provider is xkcd.com, no service name)
  • amazonaws.com/acm (provider is amazonaws.com, service name is acm).

You can find the provider and service name in the spec itself (under info, x-providerName and x-serviceName), and you can browse the raw specs directly at https://github.com/APIs-guru/openapi-directory.

License

This repo/npm module is licensed as MIT.

The license for API definitions varies by spec, see https://github.com/APIs-guru/openapi-directory#licenses for more information.

In general it's very likely that your use of any API definition is covered either by CC0 (for specs submitted directly to the directory), the spec's own license (check info.license) or by Fair Use provisions when communicating with the corresponding service. This is not formal legal advice though, its your responsibility to confirm this for yourself for the specs you're using.