calpine-node/examples/excel2json
2021-03-30 09:30:56 +07:00
..
data Add mapper config for save to output 2021-03-29 19:48:59 +07:00
.gitignore Add example for excel to json with mapper from file and add docker support 2021-03-29 17:32:54 +07:00
build.sh Updated the script and volumn for container 2021-03-29 17:46:28 +07:00
Dockerfile Updated workdir 2021-03-29 17:50:02 +07:00
excel2json.js Add function for excel2json for exported with file and data json object 2021-03-29 19:47:35 +07:00
index.js Add function for excel2json for exported with file and data json object 2021-03-29 19:47:35 +07:00
Makefile Add example for excel to json with mapper from file and add docker support 2021-03-29 17:32:54 +07:00
package.json Updated package json 2021-03-30 09:30:56 +07:00
README.md Add mapper config for save to output 2021-03-29 19:48:59 +07:00

excel2json

  • Read file excel to json
  • Custom mapping with custom columns and configs

Build

bash build

OR

make build run

Example

docker run -v /my/path:/app/data --rm -it cubetiq/node-excel2json
docker run -v /home/sombochea/excel2json:/app/data -e APP_NAME="EXCEL 2 JSON" -e MAPPER_FILE="./data/mapper.json" --rm -it cubetiq/node-excel2json

Mapper Config

{
  "data": [
    {
      "dataIndex": "Name",
      "label": "Name"
    },
    {
      "dataIndex": "Age",
      "label": "Age"
    }
  ],
  "configs": {
    "outputPath": "./data/outputs/exported",
    "outputName": "my_exported_data",
    "sheetName": "Sheet1",
    "saveToOutput": true
  }
}

Environment

APP_NAME=custom app name
INPUT_FILE=./data/mydata.xlsx
OUTPUT_PATH=./data/outputs
MAPPER_FILE=./data/mapper.json
SHEET_NAME=Sheet1
ENCODING=utf-8