HCL v2 Parser for JavaScript
JSON →This library provides a JavaScript parser for HCL (HashiCorp Configuration Language) version 2 syntax. It is currently at version 1.0.1 and appears to be actively maintained, being an updated fork of an unmaintained predecessor (`hcl2-parser`). Its key differentiator is robust support for HCL v2, which many other JavaScript parsers lack. It achieves this by wrapping the Go-based `tmccombs/hcl2json` library, transpiling the Go code to JavaScript using GopherJS. Unlike its unmaintained predecessor, this version correctly returns parsing errors to the user by rejecting a Promise, making it more reliable for production use cases like parsing Terraform configurations.
Traffic · last 30 days ↓67% vs prev 7d
total hits 14
actors 6 distinct systems
last hit 5d ago AhrefsBot
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇸🇬 Singapore · 🇩🇪 Germany
Resources
API endpoints
full doc /v1/registry/hcl2-json-parser
compatibility /v1/registry/hcl2-json-parser/compatibility