# xlsx-rw

> Utility over xlsx npm package that reads/writes excel workbooks

Latest version **1.0.8** (published 2021-02-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install xlsx-rw
pnpm add xlsx-rw
yarn add xlsx-rw
bun add xlsx-rw
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2021-02-02 |
| First published | 2019-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 24.2 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| Author | AppFeel |
| Maintainers | appfeel |

## Links

- npm: https://www.npmjs.com/package/xlsx-rw
- npm.io page: https://npm.io/package/xlsx-rw

## Dependencies (1)

- [xlsx](https://npm.io/package/xlsx.md) 0.9.13

## Recent versions

- 1.0.8 (latest) — 2021-02-02
- 1.0.7 — 2019-01-12
- 1.0.6 — 2019-01-12
- 1.0.5 — 2019-01-12
- 1.0.4 — 2019-01-11
- 1.0.3 — 2019-01-11
- 1.0.2 — 2019-01-11
- 1.0.1 — 2019-01-11
- 1.0.0 — 2019-01-11

## README

Excel Read/Write utilities<br>[![License][license]][npm-url] [![NPM version][npm-version]][npm-url] [![NPM downloads][npm-downloads]][npm-url]
==========================

[npm-url]: https://www.npmjs.com/package/xlsx-rw
[license]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
[npm-version]: https://img.shields.io/npm/v/xlsx-rw.svg?style=flat
[npm-downloads]: https://img.shields.io/npm/dm/xlsx-rw.svg?style=flat

Utility to read, write and update excels using [xlsx](https://www.npmjs.com/package/xlsx)

## RoadMap

This is a finished library with docs missing:

[x] Write typescript documentation
[ ] Update docs ExcelReader
[ ] Write ExcelWriter docs

## ExcelReader

A class to read excel sheet

```js
import { ExcelReader } from 'xlsx-rw';

const excelPath = 'excel.xlsx';
const excel = new ExcelReader(excelPath);

// Read from excel 3 colums (A, B, C) starting from first row
// until a row with no content in the columns (A, B, C) is found
const reader = excel.readRows('Seet1', 3);
let nextRow = reader.next();
while (!nextRow.done) {
    const [, b, c] = nextRow.value;
    const month = new Date(dTo.w).getMonth();
    // See more cell fields in https://www.npmjs.com/package/xlsx#cell-object
    console.log(b.t); // Cell type
    console.log(b.v); // Value
    console.log(b.w); // Text
    console.log(b.z); // Format
    console.log(b.f); // Formula
    nextRow = reader.next();
}

// Read from excel columns C, D, K, read rows 1-10
const reader = excel.readRows('Seet1', ['C', 'D', 'K'], 10);

// Read from excel columns C, D, K, starting on row 2 (skip headers row)
// until an empty row in C, D, K is found
const reader = excel.readRows('Seet1', ['C', 'D', 'K'], undefined, 2);
```

# ExcelWritter

```js
import { Workbook } from 'xlsx-rw';

const strText = `This text contains
multiple lines`;

// Generate excel sheet with some rows
const arrOfArrs = [
    ['Header text', 'Header long text', 'Header boolean', 'Header date'],
    ['value1', strText.replace(/[\r\n]+/g, '\r\n'), 2, false, new Date()],
];

const wb = new Workbook().writeData('sheet name', arrOfArrs);
const excelLocation = 'excel.xlsx';
wb.save(excelLocation);
```

---
_Source: https://npm.io/package/xlsx-rw · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
