# jsontransform

> Transforms JSON to JSON using JSON

Latest version **0.1.0** (published 2014-03-28) · 0 weekly downloads

## Install

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

Provides the command `jsontransform`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2014-03-28 |
| First published | 2014-03-28 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Ryan.Russell |
| Maintainers | russellsprouts |

## Links

- npm: https://www.npmjs.com/package/jsontransform
- Repository: http://github.com/RussellSprouts/JsonTransform
- Homepage: https://github.com/RussellSprouts/JsonTransform
- Issues: https://github.com/RussellSprouts/JsonTransform/issues
- npm.io page: https://npm.io/package/jsontransform

## Recent versions

- 0.1.0 (latest) — 2014-03-28

## README

# JsonTransform

Transforms JSON to JSON using JSON

# Installation

1. Clone the repository to your local machine.
2. Navigate to the repository folder, and execute `npm install -g ./`
   (You may need to use `sudo`.)  
3. Now you have the commandline tool `jsontransform` on your PATH.
4. Type `jsontransform --help` for usage information.

# Examples

## The Basics

data.json

	{"key": "value", "arr": []}

`jsontransform -f data.json -t "$.key"` => `"value"`  
`jsontransform -f data.json -t "$.arr"` => `[]`

---
data.json

	{"key": "value", "arr": []}

template.json
	
	{"newKey": "$.key"}

`jsontransform -f data.json -tf template.json` => `{"newKey":"value"}`

## Full Example

data.json

	{
			"minorVersion": 1
			"status": "success",
			"pizzasOrdered": [
			{
				"name": "Pepperoni",
				"price": 8,
				"toppings": [
					{"name":"pepperoni"},
					{"name":"cheese", "vegetarian": true}
				]
			},
			{
				"name": "Cheese",
				"price": 5,
				"toppings": [
					{"name":"cheese", "vegetarian":true}
				]
			}
		],
		
	}

template.json

	{
		"apiVersion": ["literal", 2, 10, ".minorVersion"]
		".status": true,
		"pizzas": [
			"foreach", ".pizzasOrdered", "$pizza",{
				"name": "$pizza.name",
				"cost": "$pizza.price",
				"toppings": "$pizza.toppings[].name"
			}
		]

	}

`jsontransform -f data.json -tf template.json`

result

	{
		"apiVersion": [2, 10, 1],
		"success": true,
		"pizzas": [
			{
				"name": "Pepperoni",
				"cost": 8,
				"toppings": ["pepperoni", "cheese"]
			},
			{
				"name": "Cheese",
				"cost": 8,
				"toppings": ["cheese"]
			}
		]
	}

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