Go to file
2021-03-30 10:16:49 +07:00
.github/workflows Add docker public action 2021-03-30 09:31:55 +07:00
data Add excel2json function and updated custom mapper from props 2021-03-30 09:16:11 +07:00
.gitignore Add excel2json function and updated custom mapper from props 2021-03-30 09:16:11 +07:00
build.sh Add excel2json function and updated custom mapper from props 2021-03-30 09:16:11 +07:00
Dockerfile Add excel2json function and updated custom mapper from props 2021-03-30 09:16:11 +07:00
excel2json.d.ts Updated the package and add function and declared type 2021-03-30 10:16:49 +07:00
excel2json.js Add excel2json function and updated custom mapper from props 2021-03-30 09:16:11 +07:00
index.js Updated and add readme with custom props 2021-03-30 09:18:01 +07:00
LICENSE Initial commit 2021-03-30 08:40:56 +07:00
Makefile Add excel2json function and updated custom mapper from props 2021-03-30 09:16:11 +07:00
package.json Updated the package and add function and declared type 2021-03-30 10:16:49 +07:00
README.md Updated and add readme with custom props 2021-03-30 09:18:01 +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
  }
}

Custom Function Props

{
    mappings: [
        {
            "dataIndex": "Name",
            "label": "Name"
        }
    ],
    saveToOutput: false
}

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