1.0.1 • Published 4 years ago

xlsx-keys-to-json v1.0.1

Weekly downloads
25
License
ISC
Repository
github
Last release
4 years ago

XLSX KEYS TO JSON

npm.io

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

From this file,

keysfren
hello.worldBonjourHello
hello.byeAu revoirBye
thank.you.guysMerciThanks

: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

namealiasdescriptiondefault
srcsexcel file to parse
destddestination folderprocess path
namendestination filename for multiple files extractionresult.json for single extract {}.json where {} will be replaced by top column
tabttab spacing in json2
multimsingle or multiple filestrue