0.0.1 • Published 6 years ago

yamfist v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago
██╗   ██╗ █████╗ ███╗   ███╗███████╗██╗███████╗████████╗
╚██╗ ██╔╝██╔══██╗████╗ ████║██╔════╝██║██╔════╝╚══██╔══╝
 ╚████╔╝ ███████║██╔████╔██║█████╗  ██║███████╗   ██║   
  ╚██╔╝  ██╔══██║██║╚██╔╝██║██╔══╝  ██║╚════██║   ██║   
   ██║   ██║  ██║██║ ╚═╝ ██║██║     ██║███████║   ██║   
   ╚═╝   ╚═╝  ╚═╝╚═╝     ╚═╝╚═╝     ╚═╝╚══════╝   ╚═╝   

yamfist

convert yaml <-> json simply and easily

Usage: yamfist input

Flags:

--file, -f boolean read from the file system

--help, -h boolean get help

--output, -o string write to the file system

--to, -t string set output format

--color, -k boolean use --no-color to turn colors off (default: true)

--verbose, -v number set verbosity 1 - 3

API

Table of Contents

json2yaml

Convert json to yaml

Parameters

  • opts object configuration object
  • source string instructions to parse

Returns Future<string> future-wrapped string

yaml2json

Convert yaml to json

Parameters

  • opts object configuration object
  • source string instructions to parse

Returns Future<string> future-wrapped json

parseJSON

read json from string

Parameters

Returns Future<object> future-wrapped value

parseYAML

read yaml from string

Parameters

  • opts object options object, passes to yaml.safeLoad / yaml.load
    • opts.safe boolean run in safe mode?
  • x string raw data to read

Returns object parsed yaml

toYAML

convert json to yaml

Parameters

  • opts object an options object to pass to yaml.dump
  • raw object raw data to read

Returns string yaml-formatted object