# k2j

> Convert plain properties key-value file to JSON.

Latest version **0.0.3** (published 2022-07-10) · MIT license · 0 weekly downloads

## Install

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

Provides the command `k2j`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2022-07-10 |
| First published | 2021-12-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 9.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | bat-io Author |
| Maintainers | sharmag |
| Keywords | property-to-json, ptoj, key, value, convert, k2j |

## Links

- npm: https://www.npmjs.com/package/k2j
- Repository: https://github.com/bat-io/k2j
- Issues: https://github.com/bat-io/k2j/issues
- npm.io page: https://npm.io/package/k2j

## Dependencies (3)

- [conf](https://npm.io/package/conf.md) ^10.1.1
- [chalk](https://npm.io/package/chalk.md) 4.1.2
- [commander](https://npm.io/package/commander.md) ^8.3.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.3 (latest) — 2022-07-10
- 0.0.2 — 2022-01-26
- 0.0.1 — 2021-12-31

## README

## k2j: A global npm module for converting key-value property to JSON

Install global module
```
npm install -g k2j
```

Run
```
k2j -i .\test\data.properties
```

Options
```
-V, --version            output the version number
-i, --input <location>   key-value property file  
-o, --output <location>  Output file
-s, --schema <input>  JSON schema to tranform  
-h, --help               display help for command

```

Sample input data

*key=valuea   
key1=value1*

More examples
```
k2j -i .\test\data.properties -s "{'k':'a','v':'b','c':'c'}"
```
Output
```
[
   {
      "a": "key",
      "b": "valuea",
      "c": "c"
   },
   {
      "a": "key1",
      "b": "value1",
      "c": "c"
   }
]
```
```
k2j -i .\test\data.properties -s "{'k':'a','v':'b'}"
```
Output
```
[
   {
      "a": "key",
      "b": "valuea"
   },
   {
      "a": "key1",
      "b": "value1"
   }
]
```
```
k2j -i .\test\data.properties
```
Output
```
[
   {
      "key": "valuea"
   },
   {
      "key1": "value1"
   }
]
```
```
k2j -i .\test\data.properties -o prop.json -s "{'k':'a','v':'b'}"
```
Output written in json file
```
prop.json
```

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