json-key-remover

Crates.iojson-key-remover
lib.rsjson-key-remover
version0.1.0
sourcesrc
created_at2022-08-24 12:24:03.833742
updated_at2022-08-24 12:24:03.833742
descriptionRemove specific keys from json
homepage
repositoryhttps://github.com/baku4/json-key-remover/
max_upload_size
id651628
size41,430
baku (baku4)

documentation

README

json-key-remover

Remove specific keys from json

Usage

Binary

# File to file
json-key-remover -i input.json -o output.json -k unnecessary_key
# Pipe to pipe
wget -q -O ${interface} | json-key-remover -k unnecessary_key | head
# Remove multiple keys
json-key-remover -i input.json -o output.json -k key_1,key_2,key_3

Rust library

use json_key_remover::KeyRemover;

// Init
let buffer_size = 64*1024;
let keys_to_remove = vec!["key_1".to_string(), "key_2".to_string()];
let mut key_remover = KeyRemover::init(buffer_size, keys_to_remove);
// Run
key_remover.process(reader, writer);

Build

With cargo

cargo build --release
Commit count: 6

cargo fmt