# tmc-json-editor

> A command-line tool for non destructively editing data in .JSON files.

Latest version **1.0.5** (published 2018-12-07) · GNU license · 0 weekly downloads

## Install

```sh
npm install tmc-json-editor
pnpm add tmc-json-editor
yarn add tmc-json-editor
bun add tmc-json-editor
```

Provides the command `tje`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2018-12-07 |
| First published | 2018-12-06 |
| Weekly downloads | 0 |
| License | GNU |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Keenan Blunt |
| Maintainers | ke3n |

## Links

- npm: https://www.npmjs.com/package/tmc-json-editor
- npm.io page: https://npm.io/package/tmc-json-editor

## Dependencies (2)

- [figlet](https://npm.io/package/figlet.md) ^1.2.1
- [commander](https://npm.io/package/commander.md) ^2.19.0

## Recent versions

- 1.0.5 (latest) — 2018-12-07
- 1.0.4 — 2018-12-07
- 1.0.3 — 2018-12-06
- 1.0.2 — 2018-12-06
- 1.0.1 — 2018-12-06
- 1.0.0 — 2018-12-06

## README

## 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: <br>
``` npm init ``` <br>
after that just hit enter until the command is through and then run: <br>
``` 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: <br>
``` tje ``` <br>
``` tje -i <path/to/the/folder/with/your/jsons> ``` <br> <br>
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](https://github.com/4Lii3N/))

---
_Source: https://npm.io/package/tmc-json-editor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
