1.0.5 • Published 5 years ago

tmc-json-editor v1.0.5

Weekly downloads
1
License
GNU
Repository
-
Last release
5 years ago

TMC-JSON-Editor

Hey there! This is a relatively simple command line tool that let's you edit many .json's at once without losing any of your original Data.


Introduction:

Basically this package will look at the directory you specified and for any json it finds it will make a new version of it, to which it will apply a Template that you can set yourself. Also it renames the files so that the next time you run the command for the same directory it doesnt overwrite the files that were already changed in a previous run.


How to install:

First you have to make a new folder (mkdir), then cd in and run: npm init after that just hit enter until the command is through and then run: npm install tmc-json-editor


Example:

Original Files:
File Name:              Content:

example.json            { '1':'1', '2':'2' } 
exampleTemplate.json    { '1':'2', '2':'1' } 
Output:
example.orig            { '1':'1', '2':'2' } 
example.Edit.json       { '1':'2', '2':'1' } 
exampleTemplate.json    { '1':'2', '2':'1' } 

How to use:

In the folder you just installed you will find a jsonTemplate.JSON, in this template you can set what objects from your original json should be altered and what they should be altered to. Once you're done editing the Template you can then go ahead and execute the 'tje' command.

the syntax for the 'tje' command is as follows:

tje tje -i <path/to/the/folder/with/your/jsons> if you dont specify a path with the -i flag the package will scan from the directory you're currently in.

The package will scan the specified directory recursively applying your template to any '.json' or '.JSON' it can find. Be careful as even if the json doesnt contain the object you specified in your template the program will just add it at the end of the file.


by 4Lii3N (Github)
1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago