@aternus/csv-to-xlsx
v3.0.5
Published
Convert CSV files to XLSX (Excel 2007+ XML Format) files via Node.js CLI or API.
Downloads
27,156
Maintainers
Readme
@aternus/csv-to-xlsx
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
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-xlsxUsage
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-macosWindows:
certutil -hashfile .\csv-to-xlsx-win.exe SHA256macOS: 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.
