|
1 |
| -# json-as-xlsx |
| 1 | +# export-json-as-xlsx |
2 | 2 |
|
3 | 3 | This is a tool that helps to build an excel from a json and it depends only on `xlsx` library
|
4 | 4 |
|
5 |
| -You can see a live example of it working on any of this sites (there are many just in case): |
6 |
| - |
7 |
| -- [xlsx.pages.dev](https://xlsx.pages.dev) |
8 |
| -- [xlsx.marroquin.dev](https://xlsx.marroquin.dev) |
9 |
| -- [xlsx.luismarroquin.com](https://xlsx.luismarroquin.com) |
10 |
| - |
11 | 5 | ## Usage
|
12 | 6 |
|
13 | 7 | ```js
|
14 |
| -import xlsx from "json-as-xlsx" |
| 8 | +import xlsx from "export-json-as-xlsx" |
15 | 9 | // or require
|
16 |
| -let xlsx = require("json-as-xlsx") |
| 10 | +let xlsx = require("export-json-as-xlsx") |
17 | 11 |
|
18 | 12 | let data = [
|
19 | 13 | {
|
@@ -96,9 +90,29 @@ Examples
|
96 | 90 | "h:mm AM/PM" // 1:10 PM
|
97 | 91 | ```
|
98 | 92 |
|
| 93 | +### Cell Object |
| 94 | + |
| 95 | +| Key | Description | |
| 96 | +| ----------- | ------------------------------------------------------------------- | |
| 97 | +| `isFormula` | use formula | |
| 98 | +| `format` | use custom format | |
| 99 | +| `type` | cell type: `b` Boolean, `n` Number, `e` error, `s` String, `d` Date | |
| 100 | +| `width` | cell width (auto width default) | |
| 101 | +| `r` | rich text encoding (if applicable) | |
| 102 | +| `h` | HTML rendering of the rich text (if applicable) | |
| 103 | +| `c` | comments associated with the cell \*\* | |
| 104 | +| `z` | number format string associated with the cell (if requested) | |
| 105 | +| `l` | cell hyperlink object (.Target holds link, .tooltip is tooltip) | |
| 106 | +| `s` | the style/theme of the cell (if applicable) | |
| 107 | + |
99 | 108 | ## Examples
|
100 | 109 |
|
101 |
| -This are files used for development, please change imports from `../../src/index` to `json-as-xlsx` |
| 110 | +This are files used for development, please change imports from `../../src/index` to `export-json-as-xlsx` |
| 111 | + |
| 112 | +- [Express with TypeScript](https://github.com/Kritskii-A/export-json-as-xlsx/blob/main/packages/demo-express) |
| 113 | +- [ReactJS with TypeScript](https://github.com/Kritskii-A/export-json-as-xlsx/blob/main/packages/demo-reactjs) |
| 114 | + |
| 115 | +## 🙏 Thanks |
102 | 116 |
|
103 |
| -- [Express with TypeScript](https://github.com/LuisEnMarroquin/json-as-xlsx/blob/main/packages/demo-express) |
104 |
| -- [ReactJS with TypeScript](https://github.com/LuisEnMarroquin/json-as-xlsx/blob/main/packages/demo-reactjs) |
| 117 | +This project is a fork of [SheetJS/sheetjs](https://github.com/sheetjs/sheetjs) combined with code from |
| 118 | +[json-as-xlsx](https://github.com/LuisEnMarroquin/json-as-xlsx) (by [LuisEnMarroquin](https://github.com/LuisEnMarroquin)). |
0 commit comments