# parse-xlsx

> parse a worksheet in an xlsx file

Latest version **0.0.6** (published 2014-09-29) · BSD-2-Clause license · 0 weekly downloads

## Install

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

Provides the command `xlsx2ndj`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2014-09-29 |
| First published | 2014-09-29 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | joyrexus |
| Maintainers | joyrexus |
| Keywords | parse, xlsx, excel, ldjson |

## Links

- npm: https://www.npmjs.com/package/parse-xlsx
- Repository: https://github.com/joyrexus/parse-xlsx
- Issues: https://github.com/joyrexus/parse-xlsx/issues
- npm.io page: https://npm.io/package/parse-xlsx

## Dependencies (2)

- [j](https://npm.io/package/j.md) ~0.3.14
- [minimist](https://npm.io/package/minimist.md) ~1.1.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.6 (latest) — 2014-09-29
- 0.0.4 — 2014-09-29
- 0.0.3 — 2014-09-29
- 0.0.2 — 2014-09-29
- 0.0.1 — 2014-09-29

## README

# parse-xlsx

A simple module and CLI for parsing tabular data in an excel worksheet.

The parser assumes that the first line of your table contains column headers:

![sample file](sample.png)


## Usage

    npm install -g parse-xlsx
    npm run test
    npm run demo
    npm run cli-demo

The CLI (`bin/xlsx2ndj`) takes an excel file as input and generates newline-delimited JSON as output:

    xlsx2ndj --sheet=Transcript sample.xlsx

This outputs ...

```json
{ "_ID": "22", "ROW": "1", "LRB": "L",     "XYZ": "x" }
{ "_ID": "22", "ROW": "2", "LRB": "L+L",   "XYZ": "y" }
{ "_ID": "22", "ROW": "3", "LRB": "L+ ",   "XYZ": "z" }
{ "_ID": "22", "ROW": "4", "LRB": "L+R+B", "XYZ": "q" }
{ "_ID": "22", "ROW": "5", "LRB": "L+R+X", "XYZ": "b" }
```

The module can be used to get particular column values or to stream records:

```javascript
var Parser = require('parse-xlsx');
        
sheet = new Parser('sample.xlsx', 'Transcript');

// get values in a column
console.log('\nValues in column `XYZ`:', sheet.values('XYZ'), "\n");

// stream parsed records as line-delimited JSON
sheet.recordStream.pipe(process.stdout);
```

Output ...

    Values in column `XYZ`: [ 'x', 'y', 'z', 'q', 'b' ] 

    {"_ID":"22","ROW":"1","LRB":"L","XYZ":"x"}
    {"_ID":"22","ROW":"2","LRB":"L+L","XYZ":"y"}
    {"_ID":"22","ROW":"3","LRB":"L+ ","XYZ":"z"}
    {"_ID":"22","ROW":"4","LRB":"L+R+B","XYZ":"q"}
    {"_ID":"22","ROW":"5","LRB":"L+R+X","XYZ":"b"}


## See Also

* [`valid-records`](https://github.com/joyrexus/valid-records) - validate
  specified fields within a set of records (ndjson)
* [`valid-xlsx`](https://github.com/joyrexus/valid-xlsx) - validate values in
  columns of an excel worksheet

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