# EnvParser

**Kind:** Class

**Source:** [`atloria-monorepo/libs/parser-core/src/parsers/config-docs/env.parser.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/parser-core/src/parsers/config-docs/env.parser.ts#L64)

Environment Variable Parser implementation

**Implements:** `IParser`

## Methods

| Method | Signature | Returns |
|---|---|---|
| `initialize` | `initialize(_config: ParserConfig)` | `Promise<void>` |
| `canParse` | `canParse(filePath: string)` | `boolean` |
| `parseFile` | `parseFile(filePath: string, content: string)` | `Promise<ParseResult>` |
| `parseFiles` | `parseFiles(files: ParseFileInput[])` | `Promise<ParseResult[]>` |
| `destroy` | `destroy()` | `Promise<void>` |

## Properties

| Property | Type |
|---|---|
| `name` | `any` |
| `version` | `any` |
| `supportedPatterns` | `any` |

## Where it refuses work

- `EnvParser` stops the work with an early return when `isExample && this.isPlaceholderValue(envVar.value)`.
- `EnvParser` stops the work with an early return when `!envVar.value || envVar.value.trim() === ''`.
- `EnvParser` stops the work with an early return when `!value || value.trim() === ''`.
- `EnvParser` stops the work with an early return when `trimmed === 'true' || trimmed === 'false'`.
- `EnvParser` stops the work with an early return when `/^-?\d+$/.test(trimmed)`.
- `EnvParser` stops the work with an early return when `/^-?\d*\.\d+$/.test(trimmed)`.

## When something fails

- `EnvParser` handles failure in 1 place: it turns it into a return value in all 1.
