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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # excel-csv-handler
2
2
 
3
- A simple Node.js library to read and write Excel (`.xlsx`, `.xls`) and CSV files, with built-in GBK encoding support for Chinese users.
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 * as XLSX from 'xlsx';
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "excel-csv-handler",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A Node.js utility to read/write Excel and CSV files with GBK encoding support",
5
5
  "main": "index.js",
6
6
  "type": "module",
Binary file