Skip to content

Commit 34203b2

Browse files
AKritskiyAKritskiy
authored andcommitted
init
1 parent 1dac19b commit 34203b2

File tree

15 files changed

+815
-727
lines changed

15 files changed

+815
-727
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
deploy:
10-
if: github.repository == 'LuisEnMarroquin/json-as-xlsx'
10+
if: github.repository == 'Kritskii-A/export-json-as-xlsx'
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
@@ -41,5 +41,5 @@ jobs:
4141
with:
4242
folder: build
4343
branch: gh-pages
44-
git-config-name: LuisEnMarroquin
45-
git-config-email: [email protected]
44+
git-config-name: AleksandrKritskii
45+
git-config-email: [email protected]

CNAME

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
xlsx.marroquin.dev
1+
kritskii-a.github.io

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @LuisEnMarroquin
1+
* @Kritskii-A

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022, LuisEnMarroquin <[email protected]>
3+
Copyright (c) 2023, Aleksandr Kritskii <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
# json-as-xlsx
1+
# export-json-as-xlsx
22

33
This is a tool that helps to build an excel from a json and it depends only on `xlsx` library
44

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-
115
## Usage
126

137
```js
14-
import xlsx from "json-as-xlsx"
8+
import xlsx from "export-json-as-xlsx"
159
// or require
16-
let xlsx = require("json-as-xlsx")
10+
let xlsx = require("export-json-as-xlsx")
1711

1812
let data = [
1913
{
@@ -96,9 +90,29 @@ Examples
9690
"h:mm AM/PM" // 1:10 PM
9791
```
9892

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+
99108
## Examples
100109

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
102116

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)).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "json-as-xlsx",
2+
"name": "export-json-as-xlsx",
33
"private": true,
44
"scripts": {
55
"bootstrap": "lerna bootstrap",

packages/demo-express/src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import express from "express"
22
import { join } from "path"
3-
import xlsx, { IJsonSheet, ISettings } from "json-as-xlsx"
3+
import xlsx, { IJsonSheet, ISettings } from "export-json-as-xlsx"
44

55
const app = express()
66
app.use(express.json())

packages/demo-reactjs/src/App.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
import xlsx from "json-as-xlsx"
1+
import xlsx from "export-json-as-xlsx"
22

33
function App() {
44
const downloadFile = () => {
55
let data = [
66
{
77
sheet: "Adults",
88
columns: [
9-
{ label: "User", value: "user" }, // Top level data
9+
{ label: "User", value: "user", isFormula: true }, // Use formuls
1010
{ label: "Age", value: "age", format: '# "years"' }, // Custom format
11-
{ label: "Phone", value: (row: any) => row?.more?.phone ?? "" }, // Run functions
11+
{ label: "Phone", value: (row: any) => row?.more?.phone ?? "", width: "5" }, // Run functions and add width
12+
{ label: "Date", value: "date", format: "DD.MM.YYYY", type: "d" }, // Set type
1213
],
1314
content: [
14-
{ user: "Andrea", age: 20, more: { phone: "11111111" } },
15-
{ user: "Luis", age: 21, more: { phone: "12345678" } },
15+
{ user: `=HYPERLINK("${window.location.origin}", "Alex")`, age: 20, more: { phone: "11111111" }, date: "1999.02.20" },
16+
{ user: "Luis", age: 21, more: { phone: "12345678" }, date: "1999.01.21" },
1617
],
1718
},
1819
{
@@ -36,11 +37,11 @@ function App() {
3637

3738
return (
3839
<div id="app">
39-
<h1>Testing json-as-xlsx</h1>
40+
<h1>Testing export-json-as-xlsx</h1>
4041
<button onClick={downloadFile}>Download</button>
4142
<h2>
4243
<span>Visit this project on: </span>
43-
<a href="https://github.com/LuisEnMarroquin/json-as-xlsx" target="_blank" rel="noreferrer">
44+
<a href="https://github.com/Kritskii-A/export-json-as-xlsx" target="_blank" rel="noreferrer">
4445
GitHub
4546
</a>
4647
</h2>

packages/main-library/package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": "json-as-xlsx",
3-
"version": "2.5.3",
2+
"name": "export-json-as-xlsx",
3+
"version": "0.0.1",
44
"license": "MIT",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"typings": "dist/index.d.ts",
88
"description": "Create excel xlsx file from json",
9-
"author": "LuisEnMarroquin <[email protected]>",
10-
"homepage": "https://xlsx.marroquin.dev",
9+
"author": "Aleksandr Kritskii <[email protected]>",
10+
"homepage": "https://kritskii-a.github.io",
1111
"type": "commonjs",
1212
"private": false,
1313
"scripts": {
@@ -35,10 +35,10 @@
3535
],
3636
"repository": {
3737
"type": "git",
38-
"url": "https://github.com/LuisEnMarroquin/json-as-xlsx.git"
38+
"url": "https://github.com/Kritskii-A/export-json-as-xlsx.git"
3939
},
4040
"bugs": {
41-
"url": "https://github.com/LuisEnMarroquin/json-as-xlsx/issues"
41+
"url": "https://github.com/Kritskii-A/export-json-as-xlsx/issues"
4242
},
4343
"keywords": [
4444
"json",
@@ -57,7 +57,9 @@
5757
"xlsx-from-json",
5858
"microsoft",
5959
"microsoft-xlsx",
60-
"microsoft-excel"
60+
"microsoft-excel",
61+
"spreadsheet",
62+
"xls"
6163
],
6264
"browserslist": [
6365
">0.2%",

packages/main-library/src/__tests__/contentProperty.test.ts

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)