open-index/open-npm huggingface dataset:
npm package: @osskit/enforce-client-headers
Description: Enforce headers against http calls to your API
Latest version: 0.0.9

# enforce-client-headers
Enforce headers against http calls to your API

## Install
```
yarn add @osskit/enforce-client-headers
```

## Usages

### Simple
```
import { enforceClientHeaders } from '@osskit/enforce-client-headers'

const server = express();
const socketServer = io();

server.use(enforceClientHeaders());
socketServer.use(enforceClientHeaders());
```

### Extra headers

```
import { enforceClientHeaders, requiredHeaders } from '@osskit/enforce-client-headers'

const server = express();
const socketServer = io();

const headers = [...requiredHeaders, 'my-extra-header'];

server.use(enforceClientHeaders({headers});
socketServer.use(enforceClientHeaders, {headers});
```

## API

### enforceClientHeaders({headers})
#### headers
Type: `string[]`

The headers you want to enforce on the request

Throws a `400 - missing ${header}` error upon missing required header

### requiredHeaders

Type: `string[]`, by default `['x-api-client', 'x-api-client-version']`
npm package: @osskit/eslint-config
Description: The ESLint config used by osskit
Author: osskit
Latest version: 2.4.0

# @osskit/eslint-config [![NPM version](https://img.shields.io/npm/v/@osskit/eslint-config.svg)](https://www.npmjs.com/package/@osskit/eslint-config)

> ESLint [shareable config](http://eslint.org/docs/developer-guide/shareable-configs.html) used by osskit.

## Install

```shell
$ npm install --save-dev @osskit/eslint-config
```
```shell
$ yarn add --dev @osskit/eslint-config
```

## Usage

Create an `eslint.config.js` file:

```js
import {baseConfig} from '@osskit/eslint-config';

export default [
  baseConfig,
];
```

### Additional Configs

This package exposes additional configs.

#### [`Test`](src/test.js)

Use this for your Vitest tests

```js
import {baseConfig, testConfig} from '@osskit/eslint-config';

export default [
  baseConfig,
  testConfig,
];
```

#### [`React`](src/react.js)

Use this for your React projects

```js
import {baseConfig, reactConfig} from '@osskit/eslint-config';

export default [
  baseConfig,
  reactConfig,
];
```

#### [`React`](src/react.js) & [`Test`](src/test.js)

Use this for your React tests

```js
import {baseConfig, reactConfig, testConfig} from '@osskit/eslint-config';

export default [
  baseConfig,
  reactConfig,
  testConfig,
];
```
npm package: @osskit/fastify-enforce-headers
Description: <p align="center"> <img width="250" height="250" src="https://user-images.githubusercontent.com/15312980/175080445-1fb834d4-7321-424f-bfb0-0b3f4f81dc91.svg" /> </p>
Latest version: 0.0.6

<p align="center">
<img width="250" height="250" src="https://user-images.githubusercontent.com/15312980/175080445-1fb834d4-7321-424f-bfb0-0b3f4f81dc91.svg" />
</p>

# fastify-enforce-headers
Enforce headers against http calls to your fastify API
  
</div>

## Install
```
yarn add @osskit/fastify-enforce-headers
```

## Usages

### Simple
```
import fastify from 'fastify';
import { enforceHeaders } from '@osskit/fastify-enforce-headers';

await fastify.register(enforceHeaders);
```

### Extra headers

```
import fastify from 'fastify';
import { enforceHeaders, defaultHeaders } from '@osskit/fastify-enforce-headers';

await fastify.register(enforceHeaders, { headers: [...defaultHeaders, 'x-custom-header'] });
```

## API

### enforceHeaders({headers})
#### headers
Type: `string[]`
Default: `[]`

The headers you want to enforce on the request

Throws a `400 - missing ${header}` error upon missing required header

### defaultHeaders

Type: `string[]` by default `['x-api-client', 'x-api-client-version']`