All Projects → gokmen → hcl-to-json

gokmen / hcl-to-json

Licence: MIT License
HCL to JSON converter in CoffeeScript

Programming Languages

coffeescript
4710 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to hcl-to-json

picasso
Picasso is a tool that can take a template and data, and generate images from them.
Stars: ✭ 16 (+6.67%)
Mutual labels:  hcl
stein
A linter for config files with a customizable rule set
Stars: ✭ 92 (+513.33%)
Mutual labels:  hcl
terraform-vsphere-single-vm
Deploy single vSphere VM with Terraform - template.
Stars: ✭ 21 (+40%)
Mutual labels:  hcl
terraform-aws-kms
This terraform module creates a KMS Customer Master Key (CMK) and its alias.
Stars: ✭ 14 (-6.67%)
Mutual labels:  hcl
terraform-modules
Terraform Modules by Peak
Stars: ✭ 16 (+6.67%)
Mutual labels:  hcl
terraform-github-actions-demo
HashiCorp Terraform Github Actions Demo for Github Satellite 2020.
Stars: ✭ 40 (+166.67%)
Mutual labels:  hcl
tree-sitter-hcl
A tree-sitter grammar for HCL (HashiCorp Configuration Language), used by projects such as Terraform.
Stars: ✭ 65 (+333.33%)
Mutual labels:  hcl
rust-hcl
A Rust library for working with the HashiCorp Configuration Language (HCL).
Stars: ✭ 14 (-6.67%)
Mutual labels:  hcl
terraform-aws-sftp
This terraform module is used to create sftp on AWS for S3.
Stars: ✭ 20 (+33.33%)
Mutual labels:  hcl
parse it
A python library for parsing multiple types of config files, envvars & command line arguments that takes the headache out of setting app configurations.
Stars: ✭ 86 (+473.33%)
Mutual labels:  hcl
krab
Krab is a migration and automation tool for PostgreSQL based on HCL syntax
Stars: ✭ 15 (+0%)
Mutual labels:  hcl
terraform-modules
Reusable Terraform modules
Stars: ✭ 12 (-20%)
Mutual labels:  hcl
terraform-provider-minio
Terraform provider for managing minio S3 buckets and IAM Users
Stars: ✭ 123 (+720%)
Mutual labels:  hcl
nomadgen
Configuration util in python syntax for Hashicorp's Nomad
Stars: ✭ 19 (+26.67%)
Mutual labels:  hcl
azure-vdc
Automated VDC on Azure
Stars: ✭ 16 (+6.67%)
Mutual labels:  hcl
terraform-templates
Terraform templates, examples, etc.
Stars: ✭ 16 (+6.67%)
Mutual labels:  hcl
transfer
Converts from one encoding to another. Supported formats HCL ⇄ JSON ⇄ YAML⇄TOML⇄XML⇄plist⇄pickle⇄properties ...
Stars: ✭ 70 (+366.67%)
Mutual labels:  hcl
vim-hcl
Syntax highlighting for HashiCorp Configuration Language (HCL)
Stars: ✭ 83 (+453.33%)
Mutual labels:  hcl
terraform-aws-autoscaling
A terraform module which provisions an auto scaling group along with its launch template
Stars: ✭ 32 (+113.33%)
Mutual labels:  hcl
torsimany
💡✏️️ ⬇️️ JSON to Markdown converter - Generate Markdown from format independent JSON
Stars: ✭ 49 (+226.67%)
Mutual labels:  json-converter

Archived project. No maintenance.

This project is not maintained anymore and is archived. Feel free to fork and make your own changes if needed.

hcl-to-json

Build Status NPM version

HCL to JSON converter for JS applications.

HCL (HashiCorp Configuration Language) is a configuration language built by HashiCorp. The goal of HCL is to build a structured configuration language that is both human and machine friendly for use with command-line tools, but specifically targeted towards DevOps tools, servers, etc.

HCL is also fully JSON compatible. That is, JSON can be used as completely valid input to a system expecting HCL. This helps makes systems interoperable with other systems.

Getting started

You can install with npm i hcl-to-json -g then simply require and pass HCL content to get JSON output. If you have a bad HCL content it's suggested to call in try .. catch block

hcltojson = require 'hcltojson'

hcltojson """

foo "bar" {
  baz = 123
  tex = ["one", "two"]
  mon "test" {
    lar = "bar"
  }
}

"""

will return following JSON object:

{
  "foo": {
    "bar": {
      "baz": 123,
      "tex": [
        "one",
        "two"
      ],
      "mon": {
        "test": {
          "lar": "bar"
        }
      }
    }
  }
}

or you can use the hcltojson cli for any hcl formatted file or standart input;

$ npm install hcl-to-json -g
$ echo "foo=3" | hcltojson
{
    "foo": 3
}

$ echo "foo bar { baz = 123 }" > test.tf
$ hcltojson test.tf
{
    "foo": {
        "bar": {
            "baz": 123
        }
    }
}

In browser you may include the dist/bundle.js which will export hcltojson function into window. You can also try it in your browser from https://runkit.com/npm/hcl-to-json

Syntax

It currently supports the high-level features of the syntax and grammar of HCL. Syntax details can be found here

Status

It's experimental now and in early stages of development, but supports lots of samples listed under test folder.

Development

You can use DEBUG="hcltojson:*" npm test watch while developing for live compile and test results with debug output.

License

MIT (c) 2016 Gokmen Goksel

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].