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-browser

v0.3.1

Published

OpenAPI Browser is a wrapper for Swagger-Editor 3.x

Downloads

87

Readme

openapi-browser

The OpenAPI Browser is a wrapper package built around the Swagger UI tool which allows you to edit Open API specifications in YAML inside your browser and preview its documentations in real time.

The OpenAPI Specification is a community-driven open specification within the OpenAPI Initiative, a Linux Foundation Collaborative Project.

OpenAPI Browser is built with swagger-ui-dist which is a dependency-free module that includes everything you need to serve Swagger UI in a project.

Features

  • Hot reload.
  • Runs as a stand-alone web application in a port of your choice.
  • View your OpenAPI yaml/json file describing your project API.

Getting Started

In a typical workflow of building an API based on the Open API specifications, you would design and model your API, write the implementation code, test it and maintain it.

Install

In a new or existing folder containing your project:

npm install openapi-browser

Usage

By default openapi-browser will run in port 30303 and will attempt to find an OpenAPI yaml file in the default path src/api/v1/api.yaml

You can add an entry to the "scripts" section in package.json:

"scripts": {
  "api:edit": "openapi-browser --file ./src/api/v1/api.yaml --port 10021"
}

You can also run it from the command line using npx

npx openapi-browser --file ./src/api/v1/api.yaml --port 10021

Or in JavaScript by importing the module

const openApiBrowser = require('openapi-browser');

const options = {
  file: './src/api/v1/api.yaml', // specify path as string or fully resolved path
  port: 10021, // specify port or omit for random port usage
  silent: false, // invoque browser or run silently
};

openApiBrowser.edit(options);

API

--file [optional]

The OpenAPI specification File to edit. Defaults to src/api/v1/api.yaml

--port [optional]

Optional port to run. Defaults to 0 or dynamically assigned port.

--silent [optional true/false]

Automatically opens default browser. Defaults to true.

Licence

This project is licensed under the MIT License

Development Setup

Clone this repo git clone https://github.com/mykeels/openapi-browser

npm install

npm run test:watch To run tests in watch mode.

npm run build or npm run build:watch To build the project.

npm test to run the tests.

Contributing

Keep it simple. Keep it minimal.

Credits

Huge props to openapi-editor. 🙌