https://github.com/boycce/xlsx-csv-rust
Fast xlsx to csv converter
https://github.com/boycce/xlsx-csv-rust
Last synced: about 1 year ago
JSON representation
Fast xlsx to csv converter
- Host: GitHub
- URL: https://github.com/boycce/xlsx-csv-rust
- Owner: boycce
- Created: 2022-09-25T23:20:51.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-31T19:19:02.000Z (over 3 years ago)
- Last Synced: 2025-03-20T16:48:47.662Z (about 1 year ago)
- Language: JavaScript
- Size: 5.05 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# xlsx-csv-rust
Fast xlsx to csv converter based on Rust package [Calamine](https://github.com/tafia/calamine). It faster than [SheetJs][https://github.com/SheetJS/sheetjs] at least 3 times and eats 5 times smaller memory
### Install
`npm install xlsx-csv-rust`
### Usage
```js
import fs from 'fs'
import { convertFile } from 'xlsx-to-csv'
const { filepath } = convertFile('./file.xlsx')
const csvData = fs.readFileSync(filepath, { encoding: 'utf-8' })
console.log(csvData)
```
### Testing
1. Install rust
2. `cargo install cargo-watch`
3. `npm run test` or `npm run test:integration` (for node integration test)
### Building for release
1. Install rust
2. Install rust target enviornments
```bash
rustup target add x86_64-apple-darwin # requires macos machine to build
rustup target add aarch64-apple-darwin # requires macos machine to build
rustup target add x86_64-pc-windows-gnu
rustup target add x86_64-unknown-linux-musl
```
3. (on linux) install build tool required for windows `sudo apt-get install mingw-w64`
4. `npm run build`
### Licence
MIT