open-index/open-npm huggingface dataset:
npm package: @praha/eslint-config-common
Description: ESLint config for PrAha
Author: PrAha, Inc.
Latest version: 4.0.3

# @praha/eslint-config-common

[![npm version](https://badge.fury.io/js/@praha%2Feslint-config-common.svg)](https://www.npmjs.com/package/@praha/eslint-config-common)
[![npm download](https://img.shields.io/npm/dm/@praha/eslint-config-common.svg)](https://www.npmjs.com/package/@praha/eslint-config-common)
[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/praha-inc/eslint-config/blob/main/packages/common/LICENSE)
[![Github](https://img.shields.io/github/followers/praha-inc?label=Follow&logo=github&style=social)](https://github.com/orgs/praha-inc/followers)

This is a ESLint config commonly inherited by PrAha products.

Use this setting to ensure consistent code writing and maintain high code quality.

## 🚀 Installation

```shell
npm install -D eslint @praha/eslint-config-common @praha/eslint-config-definer
```

## 👏 Getting Started

Create a `eslint.config.js` file in the root directory of your project, and add `@praha/eslint-config-common`.

```js
import { common } from '@praha/eslint-config-common';
import { define } from '@praha/eslint-config-definer';

const config = define(
  common,
);

export default config();
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check [issues page](https://github.com/praha-inc/eslint-config/issues) if you want to contribute.

## 📝 License

Copyright © [PrAha, Inc.](https://www.praha-inc.com/)

This project is [```MIT```](https://github.com/praha-inc/eslint-config/blob/main/packages/common/LICENSE) licensed.
npm package: @praha/eslint-config-definer
Description: ESLint config for PrAha
Author: PrAha, Inc.
Latest version: 2.0.2

# @praha/eslint-config-definer

[![npm version](https://badge.fury.io/js/@praha%2Feslint-config-definer.svg)](https://www.npmjs.com/package/@praha/eslint-config-definer)
[![npm download](https://img.shields.io/npm/dm/@praha/eslint-config-definer.svg)](https://www.npmjs.com/package/@praha/eslint-config-definer)
[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/praha-inc/eslint-config/blob/main/packages/definer/LICENSE)
[![Github](https://img.shields.io/github/followers/praha-inc?label=Follow&logo=github&style=social)](https://github.com/orgs/praha-inc/followers)

This is a ESLint config commonly inherited by PrAha products.

Use this setting to ensure consistent code writing and maintain high code quality.

## 🚀 Installation

```shell
# Install any configs.
npm install -D eslint @praha/eslint-config-common @praha/eslint-config-javascript

# Install this package.
npm install -D @praha/eslint-config-definer

# (Recommended) If you want to use the style guide, install the following package.
# However, this is not necessary if you are using Prettier.
npm install -D @praha/eslint-config-style

# (Optional) If you are using TypeScript, install the following package.
npm install -D @praha/eslint-config-typescript
```

## 👏 Getting Started

Create a `eslint.config.js` file in the root directory of your project.

```js
import { common } from '@praha/eslint-config-common';
import { define } from '@praha/eslint-config-definer';
import { javascript } from '@praha/eslint-config-javascript';
import { typescript } from '@praha/eslint-config-typescript';
import { style } from '@praha/eslint-config-style';

const config = define(
  common,
  javascript,
  style,
  // If you are using TypeScript, add the following line.
  typescript,
);

export default config({
  tsconfigPath: './tsconfig.json',
});
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check [issues page](https://github.com/praha-inc/eslint-config/issues) if you want to contribute.

## 📝 License

Copyright © [PrAha, Inc.](https://www.praha-inc.com/)

This project is [```MIT```](https://github.com/praha-inc/eslint-config/blob/main/packages/definer/LICENSE) licensed.
npm package: @praha/eslint-config-javascript
Description: ESLint config for PrAha
Author: PrAha, Inc.
Latest version: 3.0.11

# @praha/eslint-config-javascript

[![npm version](https://badge.fury.io/js/@praha%2Feslint-config-javascript.svg)](https://www.npmjs.com/package/@praha/eslint-config-javascript)
[![npm download](https://img.shields.io/npm/dm/@praha/eslint-config-javascript.svg)](https://www.npmjs.com/package/@praha/eslint-config-javascript)
[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/praha-inc/eslint-config/blob/main/packages/javascript/LICENSE)
[![Github](https://img.shields.io/github/followers/praha-inc?label=Follow&logo=github&style=social)](https://github.com/orgs/praha-inc/followers)

This is a ESLint config commonly inherited by PrAha products.

Use this setting to ensure consistent code writing and maintain high code quality.

## 🚀 Installation

```shell
# Install peer dependencies.
npm install -D eslint @praha/eslint-config-common @praha/eslint-config-definer

# Install this package.
npm install -D @praha/eslint-config-javascript

# (Recommended) If you want to use the style guide, install the following package.
# However, this is not necessary if you are using Prettier.
npm install -D @praha/eslint-config-style
```

## 👏 Getting Started

Create a `eslint.config.js` file in the root directory of your project, and add `@praha/eslint-config-javascript`.

```js
import { common } from '@praha/eslint-config-common';
import { define } from '@praha/eslint-config-definer';
import { javascript } from '@praha/eslint-config-javascript';

const config = define([
  common,
  javascript,
]);

export default config();
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check [issues page](https://github.com/praha-inc/eslint-config/issues) if you want to contribute.

## 📝 License

Copyright © [PrAha, Inc.](https://www.praha-inc.com/)

This project is [```MIT```](https://github.com/praha-inc/eslint-config/blob/main/packages/javascript/LICENSE) licensed.
npm package: @praha/eslint-config-jest
Description: ESLint config for PrAha
Author: PrAha, Inc.
Latest version: 4.0.12

# @praha/eslint-config-jest

[![npm version](https://badge.fury.io/js/@praha%2Feslint-config-jest.svg)](https://www.npmjs.com/package/@praha/eslint-config-jest)
[![npm download](https://img.shields.io/npm/dm/@praha/eslint-config-jest.svg)](https://www.npmjs.com/package/@praha/eslint-config-jest)
[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/praha-inc/eslint-config/blob/main/packages/jest/LICENSE)
[![Github](https://img.shields.io/github/followers/praha-inc?label=Follow&logo=github&style=social)](https://github.com/orgs/praha-inc/followers)

This is a ESLint config commonly inherited by PrAha products.

Use this setting to ensure consistent code writing and maintain high code quality.

## 🚀 Installation

```shell
# Install peer dependencies.
npm install -D eslint @praha/eslint-config-common @praha/eslint-config-definer @praha/eslint-config-javascript

# Install this package.
npm install -D @praha/eslint-config-jest

# (Recommended) If you want to use the style guide, install the following package.
# However, this is not necessary if you are using Prettier.
npm install -D @praha/eslint-config-style

# (Optional) If you are using TypeScript, install the following package.
npm install -D @praha/eslint-config-typescript
```

## 👏 Getting Started

Create a `eslint.config.js` file in the root directory of your project.

```js
import { common } from '@praha/eslint-config-common';
import { define } from '@praha/eslint-config-definer';
import { javascript } from '@praha/eslint-config-javascript';
import { jest } from '@praha/eslint-config-jest';
import { typescript } from '@praha/eslint-config-typescript';

const config = define([
  common,
  javascript,
  jest,
  // If you are using TypeScript, add the following line.
  typescript,
]);

export default config({
  // If you are using TypeScript, add the following line.
  tsconfigPath: './tsconfig.json',
});
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check [issues page](https://github.com/praha-inc/eslint-config/issues) if you want to contribute.

## 📝 License

Copyright © [PrAha, Inc.](https://www.praha-inc.com/)

This project is [```MIT```](https://github.com/praha-inc/eslint-config/blob/main/packages/jest/LICENSE) licensed.
npm package: @praha/eslint-config-jest-react
Description: ESLint config for PrAha
Author: PrAha, Inc.
Latest version: 4.0.14

# @praha/eslint-config-jest-react

[![npm version](https://badge.fury.io/js/@praha%2Feslint-config-jest-react.svg)](https://www.npmjs.com/package/@praha/eslint-config-jest-react)
[![npm download](https://img.shields.io/npm/dm/@praha/eslint-config-jest-react.svg)](https://www.npmjs.com/package/@praha/eslint-config-jest-react)
[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/praha-inc/eslint-config/blob/main/packages/jest-react/LICENSE)
[![Github](https://img.shields.io/github/followers/praha-inc?label=Follow&logo=github&style=social)](https://github.com/orgs/praha-inc/followers)

This is a ESLint config commonly inherited by PrAha products.

Use this setting to ensure consistent code writing and maintain high code quality.

## 🚀 Installation

```shell
# Install peer dependencies.
npm install -D eslint @praha/eslint-config-common @praha/eslint-config-definer @praha/eslint-config-javascript @praha/eslint-config-jest @praha/eslint-config-react

# Install this package.
npm install -D @praha/eslint-config-jest-react

# (Recommended) If you want to use the style guide, install the following package.
# However, this is not necessary if you are using Prettier.
npm install -D @praha/eslint-config-style

# (Optional) If you are using TypeScript, install the following package.
npm install -D @praha/eslint-config-typescript

# (Optional) If you are using Next.js, install the following package.
npm install -D @praha/eslint-config-next
```

## 👏 Getting Started

Create a `eslint.config.js` file in the root directory of your project.

```js
import { common } from '@praha/eslint-config-common';
import { define } from '@praha/eslint-config-definer';
import { javascript } from '@praha/eslint-config-javascript';
import { jest } from '@praha/eslint-config-jest';
import { jestReact } from '@praha/eslint-config-jest-react';
import { react } from '@praha/eslint-config-jest-react';
import { next } from '@praha/eslint-config-jest-next';
import { typescript } from '@praha/eslint-config-typescript';

const config = define([
  common,
  javascript,
  jest,
  jestReact,
  react,
  // If you are using TypeScript, add the following line.
  typescript,
  // If you are using Next.js, add the following line.
  next,
]);

export default config({
  // If you are using TypeScript, add the following line.
  tsconfigPath: './tsconfig.json',
});
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check [issues page](https://github.com/praha-inc/eslint-config/issues) if you want to contribute.

## 📝 License

Copyright © [PrAha, Inc.](https://www.praha-inc.com/)

This project is [```MIT```](https://github.com/praha-inc/eslint-config/blob/main/packages/jest-react/LICENSE) licensed.
npm package: @praha/eslint-config-next
Description: ESLint config for PrAha
Author: PrAha, Inc.
Latest version: 4.0.14

# @praha/eslint-config-next

[![npm version](https://badge.fury.io/js/@praha%2Feslint-config-next.svg)](https://www.npmjs.com/package/@praha/eslint-config-next)
[![npm download](https://img.shields.io/npm/dm/@praha/eslint-config-next.svg)](https://www.npmjs.com/package/@praha/eslint-config-next)
[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/praha-inc/eslint-config/blob/main/packages/next/LICENSE)
[![Github](https://img.shields.io/github/followers/praha-inc?label=Follow&logo=github&style=social)](https://github.com/orgs/praha-inc/followers)

This is a ESLint config commonly inherited by PrAha products.

Use this setting to ensure consistent code writing and maintain high code quality.

## 🚀 Installation

```shell
# Install peer dependencies.
npm install -D eslint @praha/eslint-config-common @praha/eslint-config-definer @praha/eslint-config-javascript @praha/eslint-config-react

# Install this package.
npm install -D @praha/eslint-config-next

# (Recommended) If you want to use the style guide, install the following package.
# However, this is not necessary if you are using Prettier.
npm install -D @praha/eslint-config-style

# (Optional) If you are using TypeScript, install the following package.
npm install -D @praha/eslint-config-typescript
```

## 👏 Getting Started

Create a `eslint.config.js` file in the root directory of your project.

```js
import { common } from '@praha/eslint-config-common';
import { define } from '@praha/eslint-config-definer';
import { javascript } from '@praha/eslint-config-javascript';
import { next } from '@praha/eslint-config-next';
import { react } from '@praha/eslint-config-react';
import { typescript } from '@praha/eslint-config-typescript';

const config = define([
  common,
  javascript,
  next,
  react,
  // If you are using TypeScript, add the following line.
  typescript,
]);

export default config({
  // If you are using TypeScript, add the following line.
  tsconfigPath: './tsconfig.json',
});
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check [issues page](https://github.com/praha-inc/eslint-config/issues) if you want to contribute.

## 📝 License

Copyright © [PrAha, Inc.](https://www.praha-inc.com/)

This project is [```MIT```](https://github.com/praha-inc/eslint-config/blob/main/packages/next/LICENSE) licensed.
npm package: @praha/eslint-config-react
Description: ESLint config for PrAha
Author: PrAha, Inc.
Latest version: 4.0.12

# @praha/eslint-config-react

[![npm version](https://badge.fury.io/js/@praha%2Feslint-config-react.svg)](https://www.npmjs.com/package/@praha/eslint-config-react)
[![npm download](https://img.shields.io/npm/dm/@praha/eslint-config-react.svg)](https://www.npmjs.com/package/@praha/eslint-config-react)
[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/praha-inc/eslint-config/blob/main/packages/react/LICENSE)
[![Github](https://img.shields.io/github/followers/praha-inc?label=Follow&logo=github&style=social)](https://github.com/orgs/praha-inc/followers)

This is a ESLint config commonly inherited by PrAha products.

Use this setting to ensure consistent code writing and maintain high code quality.

## 🚀 Installation

```shell
# Install peer dependencies.
npm install -D eslint @praha/eslint-config-common @praha/eslint-config-definer @praha/eslint-config-javascript

# Install this package.
npm install -D @praha/eslint-config-react

# (Recommended) If you want to use the style guide, install the following package.
# However, this is not necessary if you are using Prettier.
npm install -D @praha/eslint-config-style

# (Optional) If you are using TypeScript, install the following package.
npm install -D @praha/eslint-config-typescript
```

## 👏 Getting Started

Create a `eslint.config.js` file in the root directory of your project.

```js
import { common } from '@praha/eslint-config-common';
import { define } from '@praha/eslint-config-definer';
import { javascript } from '@praha/eslint-config-javascript';
import { react } from '@praha/eslint-config-react';
import { typescript } from '@praha/eslint-config-typescript';

const config = define([
  common,
  javascript,
  react,
  // If you are using TypeScript, add the following line.
  typescript,
]);

export default config({
  // If you are using TypeScript, add the following line.
  tsconfigPath: './tsconfig.json',
});
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check [issues page](https://github.com/praha-inc/eslint-config/issues) if you want to contribute.

## 📝 License

Copyright © [PrAha, Inc.](https://www.praha-inc.com/)

This project is [```MIT```](https://github.com/praha-inc/eslint-config/blob/main/packages/react/LICENSE) licensed.
npm package: @praha/eslint-config-style
Description: ESLint config for PrAha
Author: PrAha, Inc.
Latest version: 3.0.12

# @praha/eslint-config-style

[![npm version](https://badge.fury.io/js/@praha%2Feslint-config-style.svg)](https://www.npmjs.com/package/@praha/eslint-config-style)
[![npm download](https://img.shields.io/npm/dm/@praha/eslint-config-style.svg)](https://www.npmjs.com/package/@praha/eslint-config-style)
[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/praha-inc/eslint-config/blob/main/packages/style/LICENSE)
[![Github](https://img.shields.io/github/followers/praha-inc?label=Follow&logo=github&style=social)](https://github.com/orgs/praha-inc/followers)

This is a ESLint config commonly inherited by PrAha products.

Use this setting to ensure consistent code writing and maintain high code quality.

## 🚀 Installation

```shell
# Install peer dependencies.
npm install -D eslint @praha/eslint-config-common @praha/eslint-config-definer @praha/eslint-config-javascript

# Install this package.
npm install -D @praha/eslint-config-style

# (Optional) If you are using TypeScript, install the following package.
npm install -D @praha/eslint-config-typescript
```

## 👏 Getting Started

Create a `eslint.config.js` file in the root directory of your project.

```js
import { common } from '@praha/eslint-config-common';
import { define } from '@praha/eslint-config-definer';
import { javascript } from '@praha/eslint-config-javascript';
import { style } from '@praha/eslint-config-style';
import { typescript } from '@praha/eslint-config-typescript';

const config = define([
  common,
  javascript,
  style,
  // If you are using TypeScript, add the following line.
  typescript,
]);

export default config({
  tsconfigPath: './tsconfig.json',
});
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check [issues page](https://github.com/praha-inc/eslint-config/issues) if you want to contribute.

## 📝 License

Copyright © [PrAha, Inc.](https://www.praha-inc.com/)

This project is [```MIT```](https://github.com/praha-inc/eslint-config/blob/main/packages/style/LICENSE) licensed.
npm package: @praha/eslint-config-typescript
Description: ESLint config for PrAha
Author: PrAha, Inc.
Latest version: 3.0.12

# @praha/eslint-config-typescript

[![npm version](https://badge.fury.io/js/@praha%2Feslint-config-typescript.svg)](https://www.npmjs.com/package/@praha/eslint-config-typescript)
[![npm download](https://img.shields.io/npm/dm/@praha/eslint-config-typescript.svg)](https://www.npmjs.com/package/@praha/eslint-config-typescript)
[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/praha-inc/eslint-config/blob/main/packages/typescript/LICENSE)
[![Github](https://img.shields.io/github/followers/praha-inc?label=Follow&logo=github&style=social)](https://github.com/orgs/praha-inc/followers)

This is a ESLint config commonly inherited by PrAha products.

Use this setting to ensure consistent code writing and maintain high code quality.

## 🚀 Installation

```shell
# Install peer dependencies.
npm install -D eslint @praha/eslint-config-common @praha/eslint-config-definer @praha/eslint-config-javascript

# Install this package.
npm install -D @praha/eslint-config-typescript

# (Recommended) If you want to use the style guide, install the following package.
# However, this is not necessary if you are using Prettier.
npm install -D @praha/eslint-config-style
```

## 👏 Getting Started

Create a `eslint.config.js` file in the root directory of your project.

```js
import { common } from '@praha/eslint-config-common';
import { define } from '@praha/eslint-config-definer';
import { javascript } from '@praha/eslint-config-javascript';
import { typescript } from '@praha/eslint-config-typescript';

const config = define([
  common,
  javascript,
  typescript,
]);

export default config({
  tsconfigPath: './tsconfig.json',
});
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check [issues page](https://github.com/praha-inc/eslint-config/issues) if you want to contribute.

## 📝 License

Copyright © [PrAha, Inc.](https://www.praha-inc.com/)

This project is [```MIT```](https://github.com/praha-inc/eslint-config/blob/main/packages/typescript/LICENSE) licensed.
npm package: @praha/eslint-config-vitest
Description: ESLint config for PrAha
Author: PrAha, Inc.
Latest version: 1.0.7

# @praha/eslint-config-vitest

[![npm version](https://badge.fury.io/js/@praha%2Feslint-config-vitest.svg)](https://www.npmjs.com/package/@praha/eslint-config-vitest)
[![npm download](https://img.shields.io/npm/dm/@praha/eslint-config-vitest.svg)](https://www.npmjs.com/package/@praha/eslint-config-vitest)
[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/praha-inc/eslint-config/blob/main/packages/vitest/LICENSE)
[![Github](https://img.shields.io/github/followers/praha-inc?label=Follow&logo=github&style=social)](https://github.com/orgs/praha-inc/followers)

This is a ESLint config commonly inherited by PrAha products.

Use this setting to ensure consistent code writing and maintain high code quality.

## 🚀 Installation

```shell
# Install peer dependencies.
npm install -D eslint @praha/eslint-config-common @praha/eslint-config-definer @praha/eslint-config-javascript

# Install this package.
npm install -D @praha/eslint-config-vitest

# (Recommended) If you want to use the style guide, install the following package.
# However, this is not necessary if you are using Prettier.
npm install -D @praha/eslint-config-style

# (Optional) If you are using TypeScript, install the following package.
npm install -D @praha/eslint-config-typescript
```

## 👏 Getting Started

Create a `eslint.config.js` file in the root directory of your project.

```js
import { common } from '@praha/eslint-config-common';
import { define } from '@praha/eslint-config-definer';
import { javascript } from '@praha/eslint-config-javascript';
import { typescript } from '@praha/eslint-config-typescript';
import { vitest } from '@praha/eslint-config-vitest';

const config = define([
  common,
  javascript,
  vitest,
  // If you are using TypeScript, add the following line.
  typescript,
]);

export default config({
  // If you are using TypeScript, add the following line.
  tsconfigPath: './tsconfig.json',
});
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check [issues page](https://github.com/praha-inc/eslint-config/issues) if you want to contribute.

## 📝 License

Copyright © [PrAha, Inc.](https://www.praha-inc.com/)

This project is [```MIT```](https://github.com/praha-inc/eslint-config/blob/main/packages/vitest/LICENSE) licensed.
npm package: @praha/tagged
Description: Lightweight TypeScript tagged union (discriminated union) utilities.
Author: PrAha, Inc.
Latest version: 1.0.0

# @praha/tagged

[![npm version](https://badge.fury.io/js/@praha%2Ftagged.svg)](https://www.npmjs.com/package/@praha/tagged)
[![npm download](https://img.shields.io/npm/dm/@praha/tagged.svg)](https://www.npmjs.com/package/@praha/tagged)
[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/praha-inc/tagged/blob/main/LICENSE)
[![Github](https://img.shields.io/github/followers/praha-inc?label=Follow&logo=github&style=social)](https://github.com/orgs/praha-inc/followers)

Lightweight TypeScript tagged union (discriminated union) utilities.

## 👏 Getting Started

### Installation

```bash
npm install @praha/tagged
```

### Usage

#### Basic Usage

Define a tagged type using the `Tagged` factory:

```ts
import { Tagged } from '@praha/tagged';

const User = Tagged({
  tag: 'User',
  fields: Tagged.fields<{ name: string; age: number }>(),
});

const user = User({ name: 'Alice', age: 30 });
// => { $tag: 'User', name: 'Alice', age: 30 }
```

#### Tag-Only (No Fields)

```ts
const Loading = Tagged({ tag: 'Loading' });

const loading = Loading();
// => { $tag: 'Loading' }
```

#### Discriminated Union

Combine multiple tagged types into a union for exhaustive type narrowing:

```ts
import { Tagged } from '@praha/tagged';

const Success = Tagged({
  tag: 'Success',
  fields: Tagged.fields<{ data: string }>(),
});

const Failure = Tagged({
  tag: 'Failure',
  fields: Tagged.fields<{ message: string }>(),
});

const Loading = Tagged({
  tag: 'Loading',
});

type Result = (
  | typeof Success.$infer
  | typeof Failure.$infer
  | typeof Loading.$infer
);

const handle = (result: Result) => {
  switch (result.$tag) {
    case 'Success':
      console.log(result.data);
      break;
    case 'Failure':
      console.error(result.message);
      break;
    case 'Loading':
      console.log('Loading...');
      break;
  }
};
```

#### Inferring Types

Use `$infer` to extract the TypeScript type from a factory:

```typescript
type User = typeof User.$infer;
// => { $tag: 'User'; name: string; age: number }
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check [issues page](https://github.com/praha-inc/tagged/issues) if you want to contribute.

## 📝 License

Copyright © [PrAha, Inc.](https://www.praha-inc.com/)

This project is [```MIT```](https://github.com/praha-inc/tagged/blob/main/LICENSE) licensed.
npm package: @praha/vite-plugin-external
Description: A Vite plugin that automatically excludes Node.js built-in modules and npm dependencies from the bundle
Author: PrAha inc.
Latest version: 1.2.0

# @praha/vite-plugin-external

[![npm version](https://badge.fury.io/js/@praha%2Fvite-plugin-external.svg)](https://www.npmjs.com/package/@praha/vite-plugin-external)
[![npm download](https://img.shields.io/npm/dm/@praha/vite-plugin-external.svg)](https://www.npmjs.com/package/@praha/vite-plugin-external)
[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/praha-inc/vite-plugin-external/blob/main/LICENSE)
[![Github](https://img.shields.io/github/followers/praha-inc?label=Follow&logo=github&style=social)](https://github.com/orgs/praha-inc/followers)

A Vite plugin that automatically excludes Node.js built-in modules and npm dependencies from the bundle.

## 👏 Getting Started

### Installation

```bash
npm install @praha/vite-plugin-external
```

### Usage

To use `@praha/vite-plugin-external`, import and add it to the plugins array in your Vite configuration file:

#### Basic Usage

By default, this plugin will exclude:

- Node.js built-in modules
- Dependencies listed in package.json

```ts
import { externalPlugin } from '@praha/vite-plugin-external';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [
    externalPlugin(),
  ],
});
```

#### With Options

You can customize the behavior of the plugin by passing an options object:

```ts
import { externalPlugin } from '@praha/vite-plugin-external';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [
    externalPlugin({
      packageJsonPath: './path/to/package.json', // Specify a custom package.json path
      include: ['some-package', /^@scoped\/.*$/], // Explicitly externalize specific packages
      exclude: ['some-lib'], // Do not externalize certain packages
    }),
  ],
});
```

#### Options

| Name              | Type                                              | Description                                                                          |
|-------------------|---------------------------------------------------|--------------------------------------------------------------------------------------|
| `packageJsonPath` | `string`                                          | Path to a custom `package.json` file. Defaults to the project's root `package.json`. |
| `include`         | `string` \| `RegExp` \| `Array<string \| RegExp>` | Packages to always externalize.                                                      |
| `exclude`         | `string` \| `RegExp` \| `Array<string \| RegExp>` | Packages to explicitly prevent from being externalized.                              |

## 🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check [issues page](https://github.com/praha-inc/vite-plugin-external/issues) if you want to contribute.

## 📝 License

Copyright © [PrAha, Inc.](https://www.praha-inc.com/)

This project is [```MIT```](https://github.com/praha-inc/vite-plugin-external/blob/main/LICENSE) licensed.