json-to-yaml
v1.0.0
Published
A CLI tool to convert JSON files to YAML version or vice versa.
Downloads
9
Readme
A Node.js utility for converting between JSON and YAML formats.
Overview
This package provides simple functionality to convert:
- JSON to YAML
- YAML to JSON
Installation
# Install from npm
npm install json-to-yamlOr install locally:
npm installUsage
Command Line Interface
Convert JSON to YAML:
node index.js json-to-yaml <input.json> <output.yaml>Convert YAML to JSON:
node index.js yaml-to-json <input.yaml> <output.json>Examples
# Convert from JSON to YAML
node index.js json-to-yaml test.json test.yaml
# Convert from YAML to JSON
node index.js yaml-to-json test.yaml test.jsonFiles
index.js- Main script with CLI functionalitytest.json- Sample JSON file for testingtest.yaml- Sample YAML file for testing
Testing
Tests are written using Mocha and Chai:
npm testLicense
ISC
