Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vgsantoniazzi/js-hcl-parser
js-hcl-parser — A Go port version of HCL <> JSON parser for Javascript.
https://github.com/vgsantoniazzi/js-hcl-parser
golang hcl javascript
Last synced: 2 days ago
JSON representation
js-hcl-parser — A Go port version of HCL <> JSON parser for Javascript.
- Host: GitHub
- URL: https://github.com/vgsantoniazzi/js-hcl-parser
- Owner: vgsantoniazzi
- Created: 2020-03-31T01:37:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T09:27:37.000Z (over 1 year ago)
- Last Synced: 2024-10-30T14:43:39.540Z (14 days ago)
- Topics: golang, hcl, javascript
- Language: Go
- Homepage:
- Size: 393 KB
- Stars: 23
- Watchers: 1
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# js-hcl-parser
## Overview
This package is used to generate Javascript parser for HCL (HashiCorp Configuration Language) from official repository https://github.com/hashicorp/hcl
## Installing
```sh
$ npm install js-hcl-parser
```## Usage
See complete example under [examples](examples/)
```js
var HCL = require("js-hcl-parser")const hclInput = `
scale {
from = 72
to = 24
}
`const jsonInput = `
{
"scale": {
"from": 72,
"to": 72
}
}
`console.log(HCL.parse(hclInput))
console.log(HCL.stringify(jsonInput))
```### Building
```sh
$ go get -u github.com/hashicorp/hcl
$ go get -u github.com/gopherjs/gopherjs
$ gopherjs build . -o dist/hcl.js -m
```### Testing
```sh
$ go test ./test
``````js
$ npm test
```## Contributing
I :heart: Open source!
[Follow github guides for forking a project](https://guides.github.com/activities/forking/)
[Follow github guides for contributing open source](https://guides.github.com/activities/contributing-to-open-source/#contributing)
[Squash pull request into a single commit](http://eli.thegreenplace.net/2014/02/19/squashing-github-pull-requests-into-a-single-commit/)
## License
js-hcl-parser is released under the [MIT license](http://opensource.org/licenses/MIT).