https://github.com/cubetiq/excel2json
Excel to json with custom mapper and configs
https://github.com/cubetiq/excel2json
excel2json json xlsx
Last synced: 2 months ago
JSON representation
Excel to json with custom mapper and configs
- Host: GitHub
- URL: https://github.com/cubetiq/excel2json
- Owner: CUBETIQ
- License: mit
- Created: 2021-03-30T01:40:55.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T14:23:53.000Z (over 2 years ago)
- Last Synced: 2025-10-31T02:51:15.415Z (8 months ago)
- Topics: excel2json, json, xlsx
- Language: JavaScript
- Homepage:
- Size: 36.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# excel2json-xlsx
[](https://github.com/CUBETIQ/excel2json/actions/workflows/npm-publish.yml)
[](https://github.com/CUBETIQ/excel2json/actions/workflows/docker-publish.yml)


- Read file excel to json
- Custom mapping with custom columns and configs
- Custom props
- Docker suppport
# Install
```shell
npm i excel2json-xlsx
```
OR
```shell
yarn i excel2json-xlsx
```
OR Global Install
```shell
yarn add global excel2json-xlsx
```
Usage
```shell
excel2json-xlsx -i source.xlsx -o exported.json
```
OR
```shell
npx excel2json-xlsx -i source.xlsx -o exported.json
```
# [Docker Hub](https://hub.docker.com/r/cubetiq/excel2json)
***Pulling image***
```shell
docker pull cubetiq/excel2json
```
***Run container***
```shell
docker run --rm -it -v /my/path/data:/app/data cubetiq/excel2json -i ./data/source.xlsx -p true
```
# Build
```shell
bash build
```
OR
```shell
make build run
```
# Example
```shell
docker run -v /my/path:/app/data --rm -it cubetiq/node-excel2json
```
```shell
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
```json
{
"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
```javascript
{
mappings: [
{
"dataIndex": "Name",
"label": "Name"
}
],
saveToOutput: false
}
```
# Environment
```env
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
```