excel-csv-handler 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/excel-csv-handler-1.0.1.tgz +0 -0
- package/index.js +4 -2
- package/package.json +1 -1
- package/excel-csv-handler-1.0.0.tgz +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# excel-csv-handler
|
|
2
2
|
|
|
3
|
-
A simple Node.js library to read and write Excel (`.xlsx
|
|
3
|
+
A simple Node.js library to read and write Excel **(only for`.xlsx`)** and CSV files, with built-in GBK encoding support for Chinese users.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
Binary file
|
package/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// excel-csv-handler.js
|
|
2
|
-
import
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
|
|
3
4
|
import * as fs from 'fs';
|
|
4
5
|
import * as path from 'path';
|
|
5
6
|
import iconv from 'iconv-lite';
|
|
6
7
|
import * as csv from 'fast-csv';
|
|
7
8
|
import { writeToString } from 'fast-csv';
|
|
8
|
-
|
|
9
|
+
const require = createRequire(import.meta.url);
|
|
10
|
+
const XLSX = require('xlsx');
|
|
9
11
|
class ExcelCsvHandler {
|
|
10
12
|
/**
|
|
11
13
|
* 读取 Excel 或 CSV 文件(支持 GBK 编码)
|
package/package.json
CHANGED
|
Binary file
|