# esbuild-plugin-yaml-import

> ESBuild plugin for yaml import.

Latest version **0.1.1** (published 2021-05-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install esbuild-plugin-yaml-import
pnpm add esbuild-plugin-yaml-import
yarn add esbuild-plugin-yaml-import
bun add esbuild-plugin-yaml-import
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2021-05-27 |
| First published | 2021-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 119 |
| Author | Linbudu |
| Maintainers | linbudu |
| Keywords | esbuild, ESBuild, plugin, yaml |

## Links

- npm: https://www.npmjs.com/package/esbuild-plugin-yaml-import
- Repository: https://github.com/linbudu599/nx-plugins
- Homepage: https://github.com/linbudu599/nx-plugins/tree/master/packages/esbuild-plugin-yaml-import#readme
- Issues: https://github.com/linbudu599/nx-plugins/issues
- npm.io page: https://npm.io/package/esbuild-plugin-yaml-import

## Dependencies (2)

- [js-yaml](https://npm.io/package/js-yaml.md) ^4.1.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.0.0

## Alternatives

- [monaco-yaml](https://npm.io/package/monaco-yaml.md) — 420.1K weekly downloads
- [@crewx/workflow](https://npm.io/package/@crewx/workflow.md) — 3.1K weekly downloads
- [yaml-cat](https://npm.io/package/yaml-cat.md) — 38 weekly downloads
- [nunjucks-in-yaml](https://npm.io/package/nunjucks-in-yaml.md) — 9 weekly downloads
- [shopify-symlinks](https://npm.io/package/shopify-symlinks.md) — 3 weekly downloads

## Recent versions

- 0.1.1 (latest) — 2021-05-27
- 0.1.0 — 2021-05-24
- 0.0.1 — 2021-05-16

## README

# esbuild-plugin-yaml-import

ESBuild plugin for yaml import, by [JS-YAML](https://github.com/nodeca/js-yaml).

## Usage

**GitHub Repository/Homepage is private for now, if you got any troubles, just open issue in this [repo](https://github.com/linbudu599/Blog).**

```bash
npm i esbuild-plugin-yaml-import -D
pnpm i esbuild-plugin-yaml-import -D
yarn add esbuild-plugin-yaml-import -D
```

```typescript
import { build } from 'esbuild';
import yaml from 'esbuild-plugin-yaml-import';

(async () => {
  const res1 = await build({
    entryPoints: ['./demo.tsx'],
    bundle: true,
    outfile: './dist/main.js',
    plugins: [yaml()],
  });
})();
```

Yaml content will be parsed as JSON, and processed by ESBuild json loader.


## Configuration

See [JS-YAML documents](https://github.com/nodeca/js-yaml#load-string---options-) for details.

```typescript
export interface Options {
  // JS-YAML load options
  jsyamlLoadOptions?: JSYamlOptions;

 // transform YAML content after read file
  transformContent?: (content: string) => string;

  // transform parsed content after load
  transformParsed?: (
    data: string | number | object,
    filePath: string
  ) => object | undefined;
}

```

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