# oas-reducer

> Reduce an OpenAPI definition into a smaller subset.

Latest version **4.0.1** (published 2022-08-15) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install oas-reducer
pnpm add oas-reducer
yarn add oas-reducer
bun add oas-reducer
```

Provides the command `oas-reducer`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2022-08-15 |
| First published | 2021-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14 |
| Dependencies | 6 |
| Unpacked size | 43.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jonursenbach |
| Keywords | openapi, oas, reducer |

## Links

- npm: https://www.npmjs.com/package/oas-reducer
- Repository: https://github.com/readmeio/oas-reducer
- Homepage: https://github.com/readmeio/oas-reducer#readme
- Issues: https://github.com/readmeio/oas-reducer/issues
- npm.io page: https://npm.io/package/oas-reducer

## Dependencies (6)

- [chalk](https://npm.io/package/chalk.md) ^4.1.1
- [inquirer](https://npm.io/package/inquirer.md) ^8.1.2
- [jsonpath](https://npm.io/package/jsonpath.md) ^1.1.1
- [jsonpointer](https://npm.io/package/jsonpointer.md) ^5.0.0
- [oas-normalize](https://npm.io/package/oas-normalize.md) ^7.0.0
- [inquirer-fuzzy-path](https://npm.io/package/inquirer-fuzzy-path.md) ^2.3.0

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 4.0.1 (latest) — 2022-08-15
- 4.0.0 — 2022-08-15
- 3.0.0 — 2022-05-02
- 2.0.0 — 2022-01-31
- 1.0.4 — 2021-07-20
- 1.0.3 — 2021-07-20
- 1.0.2 — 2021-07-20
- 1.0.1 — 2021-07-20
- 1.0.0 — 2021-07-20

## README

# oas-reducer

Reduce an OpenAPI definition into a smaller subset.

[![Build](https://github.com/readmeio/oas-reducer/workflows/CI/badge.svg)](https://github.com/readmeio/oas-reducer/) [![](https://img.shields.io/npm/v/oas-reducer)](https://npm.im/oas-reducer)

[![](https://d3vv6lp55qjaqc.cloudfront.net/items/1M3C3j0I0s0j3T362344/Untitled-2.png)](https://readme.com)

## Installation

```
npm install -g oas-reducer
```

## Usage

### Library

```js
import oasReducer from 'oas-reducer';

console.log(
  oasReducer(<OpenAPI definition>, options)
);
```

> ⚠️ Note that the API definition supplied here must be: an OpenAPI 3.x definition and a JSON object.

#### Available options

- `tags`: An array of tags to reduce by. Example: `['pet']`
- `paths`: A key-value object of path + method combinations to reduce by. Example: `{'/pet': ['get', 'post']}`
  - If you wish to retain all methods of a given path, supply `*` as the method array instead. Example: `{'/pet': '*'}`

### CLI

```shell
$ oas-reducer <OpenAPI definition to reduce>
```

The CLI will walk you through a couple of questions about how and what you want to reduce the file by and then it'll prompt you to save the newly reduced API definition to a new file! 🏅

> ⚠️ Note that the API definition supplied here must be an OpenAPI 3.x definition and can be either a JSON or YAML file path.

---
_Source: https://npm.io/package/oas-reducer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
