Fast & Memory Efficient NodeJs Excel Writer using Rust Binding

Overview

FastExcel

This project need Rust to be installed, check here for Rust installation instruction

This project using Rust and Neon as a binding to Rust to execute fast and efficient memory usage for generating XLSX document from NodeJs.

This project cannot be executed via NVM based NodeJs, you should deactivate (via nvm deactivate) or use a system version installation of NodeJs (via nvm use system).

Writing a large amount of data into Excel file is not a trivial task when you have a limited memory (RAM) allocated. Especially when working at a small node on the server. This library is created to solve that problem, using the efficiency of Rust while generating a large datasheet of XLSX from CSV.

Installation

npm i -D cargo-cp-artifact

npm i fastexcel

How it works

  1. Generate the CSV
  2. Convert the CSV to XLSX

The CSV generation is happen on the NodeJs side, and converting XLSX file is on Rust side (via Neon)

Example Usage

// dummy-excel.js
const path = require('path');
const { CsvFileWriter, Converter } = require("fastexcel");

const main = async () => {
  const src = path.join(process.cwd(), 'example/source.csv');
  const dst = path.join(process.cwd(), 'example/generated.xlsx');

  const cols = [];
  const totalCols = 200; // 200 columns
  for (let i = 0; i < totalCols; i++) {
    cols.push('Col ' + (i+1));
  }

  const writer = new CsvFileWriter(src, cols);

  const totalRows = 3_00_000; // 300k rows
  for (let i = 0; i < totalRows; i++) {
    let row = [];
    
    for (let i = 0; i < totalCols; i++) {
      row.push('Col No ' + (i+1));
    }

    await writer.write(row);
  }

  await writer.close();

  // Part 2: Convert csv to excel
  const res = await Converter.toXLSX(
    src,
    dst
  );
};

main();
You might also like...
A robust, customizable, blazingly-fast, efficient and easy-to-use command line application to uwu'ify your text!
A robust, customizable, blazingly-fast, efficient and easy-to-use command line application to uwu'ify your text!

uwuifyy A robust, customizable, blazingly-fast, efficient and easy-to-use command line application to uwu'ify your text! Logo Credits: Jade Nelson Tab

Rust Imaging Library's Python binding: A performant and high-level image processing library for Python written in Rust

ril-py Rust Imaging Library for Python: Python bindings for ril, a performant and high-level image processing library written in Rust. What's this? Th

A GSL (the GNU Scientific Library) binding for Rust

rust-GSL A Rust binding for the GSL library (the GNU Scientific Library). The minimum support Rust version is 1.54. Installation This binding requires

The high-speed IAPWS-IF97 package in Rust with C and Python binding
The high-speed IAPWS-IF97 package in Rust with C and Python binding

SEUIF97 This is the Rust implementation of the high-speed IAPWS-IF97 package seuif97 with C and Python binding. It is suitable for computation-intensi

.NET PhysX 5 binding to all platforms(win, osx, linux) for 3D engine, deep learning, dedicated server of gaming.
.NET PhysX 5 binding to all platforms(win, osx, linux) for 3D engine, deep learning, dedicated server of gaming.

MagicPhysX .NET PhysX 5 binding to all platforms(win-x64, osx-x64, osx-arm64, linux-x64, linux-arm64) for 3D engine, deep learning, dedicated server o

Node.js tar binding

@napi-rs/tar Node.js tar binding https://docs.rs/tar/latest/tar/ Usage export class Entries { [Symbol.iterator](): IteratorEntry, void, void } exp

PyO3 bindings and Python interface to skani, a method for fast fast genomic identity calculation using sparse chaining.

🐍 ⛓️ 🧬 Pyskani PyO3 bindings and Python interface to skani, a method for fast fast genomic identity calculation using sparse chaining. 🗺️ Overview

A small in-memory filesystem using FUSE.

slabfs A small in-memory filesystem using FUSE. Running Simply run: RUST_LOG="slabfs=trace" cargo r -r -- mountpoint To suppress most log messages:

Command line tool for cheap and efficient email automation written in Rust

Pigeon Pigeon is a command line tool for automating your email workflow in a cheap and efficient way. Utilize your most efficient dev tools you are al

Releases(v0.1.4)
Owner
Aditya Kresna
Less "IF" is better
Aditya Kresna
Using BDK from nodejs using WASM webpack 🦀

BDK + nodejs = ❤️ This repository shows how to use the bdk library in nodejs. It's just a proof-of-concept, not a complete example, and as such, it's

Daniela Brozzoni 10 Feb 21, 2023
Microsoft Excel (XLSX) to Unicode Separated Values (USV) Rust crate

xlsx-to-usv Convert Microsoft Excel (XLSX) to Unicode Separated Values (USV). Built with the USV Rust crate. Syntax: stdin | xlsx-to-usv [options] | s

SixArm 3 Mar 31, 2024
rsv is a command line tool to deal with small and big CSV, TXT, EXCEL files (especially >10G)

csv, excel toolkit written in Rust rsv is a command line tool to deal with small and big CSV, TXT, EXCEL files (especially >10G). rsv has following fe

Zhuang Dai 39 Jan 30, 2023
Rust low-level minimalist APNG writer and PNG reader with just a few dependencies with all possible formats coverage (including HDR).

project Wiki https://github.com/js29a/micro_png/wiki at glance use micro_png::*; fn main() { // load an image let image = read_png("tmp/test.

jacek SQ6KBQ 8 Aug 30, 2023
Rust adaptation of sindresorhus/is-interactive from NodeJS

is-interactive Rust adaptation of sindresorhus/is-interactive from NodeJS Check if stdout or stderr is interactive It checks that stedout or stderr is

Sean Larkin 4 Jan 21, 2023
A small, memory efficient crawler written in Rust.

Atra - The smaller way to crawl !!This read me will we reworked in a few days. Currently I am working on a better version and a wiki for the config fi

Felix Engl 3 Mar 23, 2024
Shared memory - A Rust wrapper around native shared memory for Linux and Windows

shared_memory A crate that allows you to share memory between processes. This crate provides lightweight wrappers around shared memory APIs in an OS a

elast0ny 274 Dec 29, 2022
A fast, efficient emulator for the osu! Bancho protocol written in Rust

rosu. A fast, efficient emulator for the osu! Bancho protocol written in Rust. Setup Git clone rosu, setup your nginx (example config is in the ext fo

James 2 Sep 19, 2022
An open source, programmed in rust, privacy focused tool for reading programming resources (like stackoverflow) fast, efficient and asynchronous from the terminal.

Falion An open source, programmed in rust, privacy focused tool for reading programming resources (like StackOverFlow) fast, efficient and asynchronou

Obscurely 17 Dec 20, 2022
A fast, efficient osu! beatmap mirror written in asynchronous Rust

A fast, efficient osu! beatmap mirror written in asynchronous Rust. Supports cheesegull, aswell as osu!api v2 formats.

James 4 Oct 28, 2022