# hcl-parser

> A HCL (HashiCorp Configuration Language) Parser

Latest version **0.1.1** (published 2019-08-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install hcl-parser
pnpm add hcl-parser
yarn add hcl-parser
bun add hcl-parser
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2019-08-21 |
| First published | 2019-08-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andy Le |
| Maintainers | anhldbk |

## Links

- npm: https://www.npmjs.com/package/hcl-parser
- Homepage: https://github.com/anhldbk/hcl-parser#overview
- npm.io page: https://npm.io/package/hcl-parser

## Recent versions

- 0.1.1 (latest) — 2019-08-21
- 0.1.0 — 2019-08-21

## README

# HCL Parser

*A better HCL parser for Javascript applications*

## Overview

This parser is transpiled from [hashicorp/hcl](https://github.com/hashicorp/hcl) using [GopherJS](https://github.com/gopherjs/gopherjs).

## Installation

```sh
npm install hcl-parser
```

## Usage

```js
import {parse} from "hcl-parser"

const input = `
  allow {
    user = "admin"
  }

  deny {
    user = "anonymous"
  }
`

const [data, err] = parse(input);

if(err == null){
  // data is the JSON object you want
} else {
  // handle error
}
```

## Development

In case you may want to reproduce this library

### Build

The associated code can be found here [anhldbk/hcl-parser](https://github.com/anhldbk/hcl-parser)

To build the parser:

```sh
# Install GopherJS first
go get -u github.com/gopherjs/gopherjs

# Build JS package
gopherjs build github.com/anhldbk/hcl-parser -o lib/parser.js -m
```

### Test

```sh
npm test
```

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