{"library":"hcl2-parser","type":"library","category":null,"description":"hcl2-parser is a JavaScript library designed for parsing HashiCorp Configuration Language (HCL) version 2 strings, providing crucial utility for developers working with Terraform configurations or other systems that utilize HCLv2. It offers functions to convert HCL input into either a JSON string or a JavaScript object. A key differentiator for this package is its support for the newer HCL v2 syntax, which includes features like for-expressions, dynamic blocks, and null values, an capability often lacking in other JavaScript-based HCL parsers. The library achieves this by wrapping the Go-based `tmccombs/hcl2json` tool and transpiling the necessary Go code to JavaScript using GopherJS, resulting in a self-contained npm package. As of its initial stable release, version 1.0.3, the package includes TypeScript definitions and is primarily intended for use within Node.js environments. Its release cadence is currently nascent.","language":"javascript","status":"active","version":"1.0.3","tags":["javascript","terraform","hcl","json"],"last_verified":"Wed May 27","install":[{"cmd":"npm install hcl2-parser","imports":["import { parseToString } from 'hcl2-parser';","import { parseToObject } from 'hcl2-parser';","import * as hcl from 'hcl2-parser';","const hcl = require('hcl2-parser');"]},{"cmd":"yarn add hcl2-parser","imports":[]},{"cmd":"pnpm add hcl2-parser","imports":[]}],"homepage":null,"github":"https://github.com/benc-uk/hcl2-parser","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/hcl2-parser","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/hcl2-parser/compatibility"}}