# tinyjsontransformer

> tiny JSON Transformer is an npm package for transforming JSON data based on a provided mapping. It allows you to easily rename keys in a JSON object according to a predefined mapping, inspired by how Go handles JSON.

Latest version **1.2.2** (published 2023-09-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install tinyjsontransformer
pnpm add tinyjsontransformer
yarn add tinyjsontransformer
bun add tinyjsontransformer
```

## 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.2.2 |
| Published | 2023-09-17 |
| First published | 2023-09-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | aobakwe |
| Maintainers | aobakwewastaken |

## Links

- npm: https://www.npmjs.com/package/tinyjsontransformer
- npm.io page: https://npm.io/package/tinyjsontransformer

## Recent versions

- 1.2.2 (latest) — 2023-09-17
- 1.2.1 — 2023-09-17
- 1.2.0 — 2023-09-17
- 1.1.1 — 2023-09-17
- 1.1.0 — 2023-09-17
- 1.0.0 — 2023-09-17

## README

# tiny JSON Transformer

tiny JSON Transformer is an npm package for transforming JSON data based on a provided mapping. It allows you to easily rename keys in a JSON object according to a predefined mapping, inspired by how Go handles JSON.

## Installation

You can install JSON Transformer via npm:

```bash
npm install tinyjsontransformer --save
```

## Usage

```
import { transformJSON, JSONData, Mapping } from 'tinyjsontransformer';

// Sample JSON data
const jsonData: JSONData = {
  "page_random": 1,
  "Fruits": ["apple", "banana", "cherry"],
  "color_random": "red"
};

// Define a mapping to transform keys
const mapping: Mapping = {
  "page_random": "page",
  "Fruits": "fruits",
  "color_random": "color"
};

// Transform the JSON data
const transformedData: JSONData = transformJSON(jsonData, mapping);

console.log(transformedData);
```

## Output

```
{
  "page": 1,
  "fruits": ["apple", "banana", "cherry"],
  "color": "red"
}
```

## Author

Aobakwe

GitHub: [aobakwewastaken](https://github.com/aobakwewastaken)

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