Description
Excel2json is a Rust and WebAssembly-based library that allows easily converting files in Excel format to JSON files.
excel2json alternatives and similar libraries
Based on the "Spreadsheet" category.
Alternatively, view excel2json alternatives based on common mentions on social networks and blogs.
-
SheetJS js-xlsx
📗 SheetJS Spreadsheet Data Toolkit -- New home https://git.sheetjs.com/SheetJS/sheetjs -
HANDSONTABLE
JavaScript data grid with a spreadsheet look & feel. Works with React, Angular, and Vue. Supported by the Handsontable team âš¡ -
Luckysheet
Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source. -
ag-Grid
The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript. -
React Data Grid
Feature-rich and customizable data grid React component -
jexcel
Jspreadsheet is a lightweight vanilla javascript plugin to create amazing web-based interactive tables and spreadsheets compatible with other spreadsheet software. -
Frappe Datatable
The Missing Javascript Datatable for the Web -
FancyGrid
FancyGrid - JavaScript grid library with charts integration and server communication.
Amplication: open-source Node.js backend code generator
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of excel2json or a related project?
README
Excel2json
Excel2json is a Rust and WebAssembly-based library that allows easily converting files in Excel format to JSON files.
How to build
wasm
cargo install wasm-pack
wasm-pack build --target web
js
yarn install
yarn build
How to use via npm
- install the module
yarn add excel2json-wasm
- import the module
// worker.js
import("excel2json-wasm")
- use the module in the app
// app.js
const worker = new Worker("worker.js");
// convert excel file to json
worker.postMessage({
type: "convert",
data: file_object_or_typed_array
});
worker.addEventListener("message", e => {
if (e.data.type === "ready"){
const data = e.data.data;
const styles = e.data.styles;
//json data is ready
console.log(data, styles)
}
});
Export formulas
worker.postMessage({
type: "convert",
data: file_object_or_typed_array,
formulas: true
});
How to use from CDN
CDN links are the following:
- https://cdn.dhtmlx.com/libs/excel2json/1.1/worker.js
- https://cdn.dhtmlx.com/libs/excel2json/1.1/lib.wasm
In case you use build system like webpack, it is advised to wrap the link to CDN source into a blob object to avoid possible breakdowns:
var url = window.URL.createObjectURL(new Blob([
"importScripts('https://cdn.dhtmlx.com/libs/excel2json/1.1/worker.js');"
], { type: "text/javascript" }));
var worker = new Worker(url);
Output format
interface IConvertMessageData {
uid?: string;
data: Uint8Array | File;
sheet?: string;
styles?: boolean;
wasmPath?: string;
}
interface IReadyMessageData {
uid: string;
data: ISheetData[];
styles: IStyles[];
}
interface ISheetData {
name: string;
cols: IColumnData[];
rows: IRowData[];
cells: IDataCell[][]; // null for empty cell
merged: IMergedCell[];
}
interface IMergedCell {
from: IDataPoint;
to: IDataPoint;
}
interface IDataPoint {
column: number;
row: number;
}
interface IColumnData {
width: number;
}
interface IRowData {
height: number;
}
interface IDataCell{
v: string;
s: number:
}
interface IStyle {
fontSize?: string;
fontFamily?: string;
background?: string;
color?: string;
fontWeight?: string;
fontStyle?: string;
textDecoration?: string;
textAlign?: string;
verticalAlign?: string;
borderLeft?: string;
borderTop?: string;
borderBottom?: string;
borderRight?: string;
format?: string;
}
License
MIT
*Note that all licence references and agreements mentioned in the excel2json README section above
are relevant to that project's source code only.