https://github.com/leafoftree/yamljson
Convert between yaml and json
https://github.com/leafoftree/yamljson
convert json yaml
Last synced: 11 months ago
JSON representation
Convert between yaml and json
- Host: GitHub
- URL: https://github.com/leafoftree/yamljson
- Owner: leafOfTree
- Created: 2018-08-25T03:59:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-27T08:19:02.000Z (over 7 years ago)
- Last Synced: 2025-03-22T05:32:52.373Z (11 months ago)
- Topics: convert, json, yaml
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# yamljson
实现 yaml 和 json 文件的相互转换
covert between yaml and json files
## CLI Usage
// stdout json
yamljson config.yaml
// save as file
yamljson config.yaml > config.json
// stdout yaml
yamljson config.json
// save as file
yamljson config.json > config.yaml
## Install
npm i yamljson -g
## Document
### CLI options
-d: show debug info
-h: show help info
### API
Install in project
npm i yamlsjon
require and use `convert` method
```javascript
const yamljson = require('yamljson');
const outputYAML = yamljson.convert('./config.json');
const outputJSON = yamljson.convert('./config.yaml');
```