# xlsx-keys-to-json

> ![](https://github.com/bebz229/xlsx-keys-to-json/workflows/Release/badge.svg?branch=master)

Latest version **1.0.1** (published 2020-06-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install xlsx-keys-to-json
pnpm add xlsx-keys-to-json
yarn add xlsx-keys-to-json
bun add xlsx-keys-to-json
```

Provides the command `xkj`.

## 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.1 |
| Published | 2020-06-14 |
| First published | 2020-06-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | bebz229 |
| Maintainers | bebz229 |
| Keywords | excel, json, xlsx, xkj |

## Links

- npm: https://www.npmjs.com/package/xlsx-keys-to-json
- Repository: https://github.com/bebz229/xlsx-keys-to-json
- Homepage: https://github.com/bebz229/xlsx-keys-to-json#readme
- Issues: https://github.com/bebz229/xlsx-keys-to-json/issues
- npm.io page: https://npm.io/package/xlsx-keys-to-json

## Dependencies (2)

- [yargs](https://npm.io/package/yargs.md) ^15.1.0
- [node-xlsx](https://npm.io/package/node-xlsx.md) ^0.15.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

- 1.0.1 (latest) — 2020-06-14

## README

# XLSX KEYS TO JSON

![](https://github.com/bebz229/xlsx-keys-to-json/workflows/Release/badge.svg?branch=master)

This project is a helper to convert excel keys files to json. You can use it for an i18n purpose.

From this file,

| keys | fr | en |
|:---:|:---:|:---:|
| hello.world | Bonjour | Hello|
| hello.bye | Au revoir | Bye |
| thank.you.guys | Merci | Thanks |

:warning: `keys` should be used to define keys column!

You can generate single `result.json` or multiple `fr.json`, `en.json` files.
The `en.json` looks like that 
```
{
  "hello": {
    "world": "Hello",
    "bye": "Bye"
  },
  "thank": {
    "you": {
      "guys": "Thanks"
    }
  }
}
```

## Usage

Install module locally `npm i xlsx-keys-to-json` or globally

### Cli

`xkj --src example/example.xlsx --dest example/yes/yes --name i18n_{}.json --tab 4 --multi true`

### Js

```
const { extract } = require('xlsx-keys-to-json');

extract(options);
```

## Options

| name | alias | description | default |
|---|---|---|---|
|src|s|excel file to parse||
|dest|d|destination folder|process path|
|name|n|destination filename for multiple files extraction|result.json for single extract {}.json where `{}` will be replaced by top column |
|tab|t|tab spacing in json |2|
|multi|m| single or multiple files| true |

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