open-index/open-npm huggingface dataset:
npm package: @rollup/plugin-inject
Description: Scan modules for global variables and injects `import` statements where necessary
Author: Rich Harris
Latest version: 5.0.5

[npm]: https://img.shields.io/npm/v/@rollup/plugin-inject
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-inject
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-inject
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-inject

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-inject

🍣 A Rollup plugin which scans modules for global variables and injects `import` statements where necessary.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Using npm:

```console
npm install @rollup/plugin-inject --save-dev
```

## Usage

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```js
import inject from '@rollup/plugin-inject';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [
    inject({
      Promise: ['es6-promise', 'Promise']
    })
  ]
};
```

Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).

This configuration above will scan all your files for global Promise usage and plugin will add import to desired module (`import { Promise } from 'es6-promise'` in this case).

Examples:

```js
{
  // import { Promise } from 'es6-promise'
  Promise: [ 'es6-promise', 'Promise' ],

  // import { Promise as P } from 'es6-promise'
  P: [ 'es6-promise', 'Promise' ],

  // import $ from 'jquery'
  $: 'jquery',

  // import * as fs from 'fs'
  fs: [ 'fs', '*' ],

  // use a local module instead of a third-party one
  'Object.assign': path.resolve( 'src/helpers/object-assign.js' ),
}
```

Typically, `@rollup/plugin-inject` should be placed in `plugins` _before_ other plugins so that they may apply optimizations, such as dead code removal.

## Options

In addition to the properties and values specified for injecting, users may also specify the options below.

### `exclude`

Type: `String` | `Array[...String]`<br>
Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should _ignore_. By default no files are ignored.

### `include`

Type: `String` | `Array[...String]`<br>
Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.

## Meta

[CONTRIBUTING](/.github/CONTRIBUTING.md)

[LICENSE (MIT)](/LICENSE)
npm package: @rollup/plugin-json
Description: Convert .json files to ES6 modules
Author: rollup
Latest version: 6.1.0

[npm]: https://img.shields.io/npm/v/@rollup/plugin-json
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-json
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-json
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-json

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-json

🍣 A Rollup plugin which Converts .json files to ES6 modules.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Using npm:

```console
npm install @rollup/plugin-json --save-dev
```

## Usage

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```js
import json from '@rollup/plugin-json';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [json()]
};
```

Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).

With an accompanying file `src/index.js`, the local `package.json` file would now be importable as seen below:

```js
// src/index.js
import { readFileSync } from 'fs';

const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'));
console.log(`running version ${pkg.version}`);
```

## Options

### `compact`

Type: `Boolean`<br>
Default: `false`

If `true`, instructs the plugin to ignore `indent` and generates the smallest code.

### `exclude`

Type: `String` | `Array[...String]`<br>
Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should _ignore_. By default no files are ignored.

### `include`

Type: `String` | `Array[...String]`<br>
Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.

### `includeArbitraryNames`

Type: `Boolean`<br>
Default: `false`

If `true` and `namedExports` is `true`, generates a named export for not a valid identifier properties of the JSON object by leveraging the ["Arbitrary Module Namespace Identifier Names" feature](https://github.com/tc39/ecma262/pull/2154).

### `indent`

Type: `String`<br>
Default: `'\t'`

Specifies the indentation for the generated default export.

### `namedExports`

Type: `Boolean`<br>
Default: `true`

If `true`, instructs the plugin to generate a named export for every property of the JSON object.

### `preferConst`

Type: `Boolean`<br>
Default: `false`

If `true`, instructs the plugin to declare properties as variables, using either `var` or `const`. This pertains to tree-shaking.

## Meta

[CONTRIBUTING](/.github/CONTRIBUTING.md)

[LICENSE (MIT)](/LICENSE)
npm package: @rollup/plugin-strip
Description: Remove debugger statements and functions like assert.equal and console.log from your code
Author: Rich Harris
Latest version: 3.0.4

[npm]: https://img.shields.io/npm/v/@rollup/plugin-strip
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-strip
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-strip
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-strip

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-strip

🍣 A Rollup plugin to remove `debugger` statements and functions like `assert.equal` and `console.log` from your code.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Using npm:

```console
npm install @rollup/plugin-strip --save-dev
```

## Usage

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```js
import strip from '@rollup/plugin-strip';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [
    strip({
      labels: ['unittest']
    })
  ]
};
```

Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).

## Options

### `include`

Type: `String | RegExp | Array[...String|RegExp]`<br>
Default: `['**/*.js']`<br>
Example: `include: '**/*.(mjs|js)',`<br>

A pattern, or array of patterns, which specify the files in the build the plugin should operate on.

### `exclude`

Type: `String | RegExp | Array[...String|RegExp]`<br>
Default: `[]`<br>
Example: `exlude: 'tests/**/*',`<br>

A pattern, or array of patterns, which specify the files in the build the plugin should _ignore_.

### `debugger`

Type: `Boolean`<br>
Default: `true`<br>
Example: `debugger: false,`<br>

If `true` instructs the plugin to remove debugger statements.

### `functions`

Type: `Array[...String]`<br>
Default: `[ 'console.*', 'assert.*' ]`<br>
Example: `functions: [ 'console.log', 'MyClass.Test' ],`<br>

Specifies the functions that the plugin will target and remove.

_Note: specifying functions that are used at the begining of a chain, such as 'a().b().c()', will result in '(void 0).b().c()' which will generate an error at runtime._

### `labels`

Type: `Array[...String]`<br>
Default: `[]`<br>
Example: `labels: ['unittest'],`<br>

Specifies the [labeled blocks or statements](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label) that the plugin will target and remove.

_Note: the '**:**' is implied and should not be specified in the config._

### `sourceMap`

Type: `Boolean`<br>
Default: `true`<br>
Example: `sourceMap: false,`<br>

If `true`, instructs the plugin to update source maps accordingly after removing configured targets from the bundle.

## Meta

[CONTRIBUTING](/.github/CONTRIBUTING.md)

[LICENSE (MIT)](/LICENSE)
npm package: @rollup/plugin-sucrase
Description: Compile TypeScript, Flow, JSX, etc with Sucrase
Author: Rich Harris
Latest version: 5.1.0

[npm]: https://img.shields.io/npm/v/@rollup/plugin-sucrase
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-sucrase
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-sucrase
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-sucrase

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-sucrase

🍣 A Rollup plugin which compiles TypeScript, Flow, JSX, etc with Sucrase.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v2.53.1+.

## Install

Using npm:

```console
npm install @rollup/plugin-sucrase --save-dev
```

## Usage

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin. An example of compiling TypeScript (the node-resolve plugin is added to automatically add file extensions, since TypeScript expects not to find them):

```js
import sucrase from '@rollup/plugin-sucrase';
import resolve from '@rollup/plugin-node-resolve';

export default {
  input: 'src/index.ts',
  output: {
    file: 'dist/bundle.js',
    format: 'cjs'
  },
  plugins: [
    resolve({
      extensions: ['.js', '.ts']
    }),
    sucrase({
      exclude: ['node_modules/**'],
      transforms: ['typescript']
    })
  ]
};
```

Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).

## Options

The following [Sucrase options](https://github.com/alangpierce/sucrase#transforms) may be passed as options for this plugin:

- `disableESTransforms`
- `enableLegacyBabel5ModuleInterop`
- `enableLegacyTypeScriptModuleInterop`
- `injectCreateRequireForImportRequire`
- `jsxFragmentPragma`
- `jsxImportSource`
- `jsxPragma`
- `jsxRuntime`
- `preserveDynamicImport`
- `production`
- `transforms`

### `exclude`

Type: `String` | `Array[...String]`
Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should _ignore_. By default no files are ignored.

### `include`

Type: `String` | `Array[...String]`
Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.

## Meta

[CONTRIBUTING](/.github/CONTRIBUTING.md)

[LICENSE (MIT)](/LICENSE)
npm package: @rollup/plugin-swc
Description: Transpile JavaScript/TypeScript code with swc.
Author: Peter Placzek
Latest version: 0.4.0

[npm]: https://img.shields.io/npm/v/@rollup/plugin-swc
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-swc
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-swc
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-swc

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-swc

🍣 A Rollup plugin to transpile TypeScript/JavaScript with the speedy-web-compiler (swc).

The plugin makes it possible to avoid the usage of `@rollup/plugin-babel` and `@rollup/plugin-typescript`.
It is also blazingly fast 🔥 (between 20 - 70 times faster than Babel depending on how many cpu cores are used).

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v3.0+.

## Install

Using npm:

```console
npm install @swc/core @rollup/plugin-swc --save-dev
```

## Usage

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```typescript
import swc from '@rollup/plugin-swc';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [swc()]
};
```

Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).

## Options

The plugin accepts an object as input parameter to modify the default behaviour.

### `swc`

- Type: [Options](https://swc.rs/docs/configuration/swcrc)
- Default: `undefined`

```typescript
import type { Options as SWCOptions } from '@swc/core';

declare type Options = {
  swc?: SWCOptions;
};
```

### `exclude`

- Type: `String` | `Array[...String]`
- Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch),
or array of patterns, which specifies the files in the build the plugin should _ignore_. By default no files are ignored.

### `include`

- Type: `String` | `Array[...String]`
- Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch),
or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.

## Alternatives

Alternative transpiler/transformer, which are also officially offered, are [Babel](https://www.npmjs.com/package/@rollup/plugin-babel) and [Sucrase](https://www.npmjs.com/package/@rollup/plugin-sucrase).
Both Babel and Sucrase are written in JavaScript, whereas the core of SWC is written in Rust. In addition, Sucrase transforms code to ES6+, whereas babel and SWC also support ES3 upwards.

## Meta

[CONTRIBUTING](/.github/CONTRIBUTING.md)

[LICENSE (MIT)](/LICENSE)
npm package: @rollup/plugin-terser
Description: Generate minified bundle
Author: Peter Placzek
Latest version: 1.0.0

[npm]: https://img.shields.io/npm/v/@rollup/plugin-terser
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-terser
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-terser
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-terser

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-terser

🍣 A Rollup plugin to generate a minified bundle with terser.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v2.0+.

## Install

Using npm:

```console
npm install @rollup/plugin-terser --save-dev
```

## Usage

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```typescript
import terser from '@rollup/plugin-terser';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [terser()]
};
```

Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).

## Options

The plugin accepts a terser [Options](https://github.com/terser/terser#minify-options) object as input parameter,
to modify the default behaviour.

In addition to the `terser` options, it is also possible to provide the following options:

### `maxWorkers`

Type: `Number`<br>
Default: `undefined`

Instructs the plugin to use a specific amount of cpu threads.

```typescript
import terser from '@rollup/plugin-terser';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [
    terser({
      maxWorkers: 4
    })
  ]
};
```

## Meta

[CONTRIBUTING](/.github/CONTRIBUTING.md)

[LICENSE (MIT)](/LICENSE)
npm package: @rollup/plugin-virtual
Description: Load virtual modules from memory
Author: Rich Harris
Latest version: 3.0.2

[npm]: https://img.shields.io/npm/v/@rollup/plugin-virtual
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-virtual
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-virtual
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-virtual

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-virtual

🍣 A Rollup plugin which loads virtual modules from memory.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Using npm:

```console
npm install @rollup/plugin-virtual --save-dev
```

## Usage

_Note. Use this plugin **before** any others such as node-resolve or commonjs, so they do not alter the output._

Suppose an entry file containing the snippet below exists at `src/entry.js`, and attempts to load `batman` and `src/robin.js` from memory:

```js
// src/entry.js
import batman from 'batman';
import robin from './robin.js';

console.log(batman, robin);
```

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```js
import virtual from '@rollup/plugin-virtual';

export default {
  input: 'src/entry.js',
  // ...
  plugins: [
    virtual({
      batman: `export default 'na na na na na'`,
      'src/robin.js': `export default 'batmannnnn'`
    })
  ]
};
```

Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).

## Options

This plugin has no formal options. The lone parameter for this plugin is an `Object` containing properties that correspond to a `String` containing the virtual module's code.

## Using the Plugin for Bundle Input

It's possible to use the plugin to specify an entry point for a bundle. To do so, implement a pattern simple to what is shown below:

```js
import virtual from '@rollup/plugin-virtual';

export default {
  input: 'entry',
  // ...
  plugins: [
    virtual({
      entry: `
import batman from 'batcave';
console.log(batman);
`
    })
  ]
};
```

## License

[MIT](LICENSE)
npm package: @rollup/plugin-yaml
Description: Convert YAML files to ES6 modules
Author: rollup
Latest version: 4.1.2

[npm]: https://img.shields.io/npm/v/@rollup/plugin-yaml
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-yaml
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-yaml
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-yaml

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-yaml

🍣 A Rollup plugin which Converts YAML files to ES6 modules.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Using npm:

```console
npm install @rollup/plugin-yaml --save-dev
```

## Usage

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```js
import yaml from '@rollup/plugin-yaml';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [yaml()]
};
```

Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).

With an accompanying file `src/index.js`, the local `heroes.yaml` file would now be importable as seen below:

```js
// src/index.js
import { batman } from './heroes.yaml';

console.log(`na na na na ${batman}`);
```

## Options

### `documentMode`

Type: `String`<br>
Default: `single`

If `single`, specifies that the target YAML documents contain only one document in the target file(s). If more than one [document stream](https://yaml.org/spec/1.2/spec.html#id2801681) exists in the target YAML file(s), set `documentMode: 'multi'`.

### `exclude`

Type: `String` | `Array[...String]`<br>
Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should _ignore_. By default no files are ignored.

### `include`

Type: `String` | `Array[...String]`<br>
Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.

### `safe`

Type: `Boolean`<br>
Default: `true`

If `true`, specifies that the data in the target YAML file(s) contain trusted data and should be loaded normally. If `false`, data is assumed to be untrusted and will be loaded using [safety methods](https://github.com/nodeca/js-yaml#safeload-string---options-).

### `transform`

Type: `Function`<br>
Default: `undefined`

A function which can optionally mutate parsed YAML. The function should return the mutated `object`, or `undefined` which will make no changes to the parsed YAML.

```js
yaml({
  transform(data, filePath) {
    if (Array.isArray(data) && filePath === './my-file.yml') {
      return data.filter((character) => !character.batman);
    }
  }
});
```

## Meta

[CONTRIBUTING](/.github/CONTRIBUTING.md)

[LICENSE (MIT)](/LICENSE)
npm package: @rollupjs/eslint-config-typescript
Description: ESLint Shareable Config for TypeScript
Latest version: 24.0.0

[![npm version](https://badge.fury.io/js/%40rollupjs%2Feslint-config-typescript.svg)](https://badge.fury.io/js/%40rollupjs%2Feslint-config-typescript)
[![lint](https://github.com/rollup-community/eslint-config-typescript/actions/workflows/lint.yml/badge.svg)](https://github.com/rollup-community/eslint-config-typescript/actions/workflows/lint.yml)
[![ESLint Recommended](https://img.shields.io/badge/eslint-recommended-%234B32C3)](https://github.com/eslint-recommended)

# @rollupjs/eslint-config-typescript

ESLint Shareable Config for TypeScript

## Installation

npm:

```sh
npm i -D @rollupjs/eslint-config-typescript
```

Yarn:

```sh
yarn add -D @rollupjs/eslint-config-typescript
```

## Usage

Add `@rollupjs/eslint-config-typescript` to `extends` of your ESLint config.

```js
module.exports = {
  extends: [
    '@rollupjs/eslint-config-typescript'
    // add other rulesets here if needed
  ],
  rules: {
    // override/add rules settings here if needed
  }
}
```