@aternus/csv-to-xlsx

中文文档
3.0.5发布于 2025/10/26MITTypeScriptCommonJS近 30 天下载 1万

Convert CSV files to XLSX (Excel 2007+ XML Format) files via Node.js CLI or API.

原始使用文档
文档目录11 节
  1. Features
  2. Installation
  3. Usage
  4. Binaries
  5. Node.js CLI
  6. Node.js API
  7. Safe use of Binaries
  8. Checking sha256 of a binary
  9. macOS: how to run csv-to-xlsx
  10. Windows: how to run csv-to-xlsx
  11. License

@aternus/csv-to-xlsx

version on npm version on GitHub required node version license npm downloads

Convert CSV files to XLSX (Excel 2007+ XML Format) files.

Written in JavaScript. Available for Node.js CLI and API.

Binaries are available for:

  • Windows x64
  • Linux x64
  • macOS x64

validate

Install with confidence 🛡️

Features

  • Binaries: download and run via your OS's command-line utility
  • Fast and Reliable
  • Full UTF-8 support
  • CSV Column detection
  • Batch mode: convert a CSV folder to an XLSX folder
  • Node.js CLI and API

Installation

npm install @aternus/csv-to-xlsx

Usage

Binaries

Download the executables from the latest release.

./csv-to-xlsx-linux -i "input-file-or-directory" -o "output-directory"

Make sure to ONLY use the binaries provided by the project, safe use of binaries (how to avoid viruses).

Node.js CLI

Type --help for a full list of options.

npx @aternus/csv-to-xlsx -i "input-file-or-directory" -o "output-directory"

Node.js API

const path = require('path');
const {convertCsvToXlsx} = require('@aternus/csv-to-xlsx');

let source = path.join(__dirname, 'report.csv');
let destination = path.join(__dirname, 'converted_report.xlsx');

try {
  convertCsvToXlsx(source, destination);
} catch (e) {
  console.error(e.toString());
}

Safe use of Binaries

One of the project's goals is to allow running the CSV to XLSX tool directly on your computer.

Create a directory, put the executable inside of it, create a csv folder for the CSVs and the xlsx folder will be populated with the converted files; plain and simple, you don't even have to use a terminal (CLI).

To achieve this goal, we pack all the code that makes this possible into a single file, called a binary. This binary has a couple of parts, a Node.js runtime and the source code of this tool that uses it.

Unfortunately, this causes some Antivirus programs to flag it as a Trojan. This is a known issue and should be fixed when Node.js ships with a built-in mode for generating single executable applications.

Until then, please make sure that you download binaries from the release page of csv-to-xlsx.

If you have doubts about the origin of your executable, you can check the sha256 of your executable against the one specified in the release assets.

Checking sha256 of a binary

macOS / Linux

shasum -a 256 ./csv-to-xlsx-macos

Windows:

certutil -hashfile .\csv-to-xlsx-win.exe SHA256

macOS: how to run csv-to-xlsx

csv-to-xlsx binary - macOS.webm

Windows: how to run csv-to-xlsx

csv-to-xlsx binary - windows.webm

License

Released under the MIT License - see LICENSE.md for details.

版本与发布记录

@aternus/csv-to-xlsx 共发布 41 个版本,首次发布于 2018/09/18;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.0.5latest2025/10/261 年前
3.0.42025/10/261 年前
3.0.32025/10/221 年前
3.0.22025/09/271.1 年前
3.0.12025/08/161.2 年前
3.0.02025/08/161.2 年前

关于 @aternus/csv-to-xlsx 的常见问题

@aternus/csv-to-xlsx 是什么?

Convert CSV files to XLSX (Excel 2007+ XML Format) files via Node.js CLI or API.

如何安装 @aternus/csv-to-xlsx?

在项目目录运行 npm install @aternus/csv-to-xlsx,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 csv-to-xlsx,可以用 npx csv-to-xlsx 直接运行。

@aternus/csv-to-xlsx 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aternus/csv-to-xlsx 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@aternus/csv-to-xlsx 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@aternus/csv-to-xlsx 可以商用吗?

@aternus/csv-to-xlsx 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@aternus/csv-to-xlsx 的下载量有多少?

根据 npm 官方下载统计,@aternus/csv-to-xlsx 在 2026/10/07 – 2026/11/05 这 30 天内被下载 10,313 次,日均约 344 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aternus/csv-to-xlsx 还在维护吗?

最新版本 3.0.5 发布于 2025/10/26(1 年前);至今共发布 41 个版本,其中过去 12 个月发布了 0 个;首次发布于 2018/09/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。