Skip to content

bat-io/k2j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k2j: A global npm module for converting key-value property to JSON

Install global module

npm install -g k2j

Run

k2j -i .\test\data.properties

Options

-V, --version            output the version number
-i, --input <location>   key-value property file  
-o, --output <location>  Output file
-s, --schema <input>  JSON schema to tranform  
-h, --help               display help for command

Sample input data

key=valuea
key1=value1

More examples

k2j -i .\test\data.properties -s "{'k':'a','v':'b','c':'c'}"

Output

[
   {
      "a": "key",
      "b": "valuea",
      "c": "c"
   },
   {
      "a": "key1",
      "b": "value1",
      "c": "c"
   }
]
k2j -i .\test\data.properties -s "{'k':'a','v':'b'}"

Output

[
   {
      "a": "key",
      "b": "valuea"
   },
   {
      "a": "key1",
      "b": "value1"
   }
]
k2j -i .\test\data.properties

Output

[
   {
      "key": "valuea"
   },
   {
      "key1": "value1"
   }
]
k2j -i .\test\data.properties -o prop.json -s "{'k':'a','v':'b'}"

Output written in json file

prop.json

About

NodeJS based CLI tool for converting key-value property to JSON

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published