# tiny-editorconfig

> A tiny isomorphic parser and resolver for EditorConfig.

Latest version **1.0.2** (published 2026-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install tiny-editorconfig
pnpm add tiny-editorconfig
yarn add tiny-editorconfig
bun add tiny-editorconfig
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2026-02-21 |
| First published | 2023-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Maintainers | fabiospampinato |
| Keywords | editorconfig, parser, resolver |

## Links

- npm: https://www.npmjs.com/package/tiny-editorconfig
- Repository: https://github.com/fabiospampinato/tiny-editorconfig
- Homepage: https://github.com/fabiospampinato/tiny-editorconfig#readme
- Issues: https://github.com/fabiospampinato/tiny-editorconfig/issues
- npm.io page: https://npm.io/package/tiny-editorconfig

## Dependencies (2)

- [zeptomatch](https://npm.io/package/zeptomatch.md) ^2.1.0
- [ini-simple-parser](https://npm.io/package/ini-simple-parser.md) ^1.0.1

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2026-02-21
- 1.0.1 — 2025-10-14
- 1.0.0 — 2023-11-15

## README

# Tiny EditorConfig

A tiny isomorphic parser and resolver for [EditorConfig](https://editorconfig.org/).

## Install

```sh
npm install tiny-editorconfig
```

## Usage

```ts
import * as EditorConfig from 'tiny-editorconfig';

// It can parse an .editorconfig string

const INPUT1 = `
  root=true

  [*]
  charset = UTF-8
  end_of_line = lf
  indent_size = 2
  indent_style = "space"
  insert_final_newline = true
  trim_trailing_whitespace = true

  [*.md]
  trim_trailing_whitespace = false
`;

const parsed1 = EditorConfig.parse ( INPUT1 );
// {
//   root: true,
//   overrides: {
//     '*': {
//       charset: 'utf-8',
//       endOfLine: 'lf',
//       indentSize: 2,
//       indentStyle: 'space',
//       insertFinalNewline: true,
//       trimTrailingWhitespace: true
//     },
//     '*.md': {
//       trimTrailingWhitespace: false
//     }
//   }
// }

const INPUT2 = `
  [*]
  end_of_line = crlf
  indent_size = 4
`;

const parsed2 = EditorConfig.parse ( INPUT2 );
// {
//   overrides: {
//     '*': {
//       endOfLine: 'crlf',
//       indentSize: 4
//     }
//   }
// }

// It can resolve multiple configurations for a given path

const resolved = resolve ( [PARSED1, PARSED2], '/path/to/test.md' );
// {
//   root: true,
//   charset: 'utf-8',
//   endOfLine: 'crlf',
//   indentSize: 4,
//   indentStyle: 'space',
//   insertFinalNewline: true,
//   trimTrailingWhitespace: false
// }
```

## License

MIT © Fabio Spampinato

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