# parseexcel

> Parse excel file by path or all files from directory to javaScript objects or to JSON

Latest version **1.0.7** (published 2020-09-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install parseexcel
pnpm add parseexcel
yarn add parseexcel
bun add parseexcel
```

## 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.7 |
| Published | 2020-09-04 |
| First published | 2020-08-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Bartoshevich_m |
| Maintainers | bartoshevich_m |

## Links

- npm: https://www.npmjs.com/package/parseexcel
- Repository: https://github.com/BartoshevichM/parse-excel
- Homepage: https://github.com/BartoshevichM/parse-excel#readme
- Issues: https://github.com/BartoshevichM/parse-excel/issues
- npm.io page: https://npm.io/package/parseexcel

## Dependencies (1)

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

## Recent versions

- 1.0.7 (latest) — 2020-09-04
- 1.0.6 — 2020-08-29
- 1.0.5 — 2020-08-22
- 1.0.4 — 2020-08-22
- 1.0.3 — 2020-08-16
- 1.0.2 — 2020-08-16
- 1.0.1 — 2020-08-16
- 1.0.0 — 2020-08-15

## README

## Usage

| animal | weight | color  |
|--------|-------:|:------:|
| dog    | 20 kg   | black |
| cat    | 5 kg    | white |
| mouse  | 0.15 kg | gray  |

### 1. Parse excel file by path to array of javaScript objects
```bash
const { parseObj } = require('parseexcel')

const resArr = parseObj(filePath)
```

### Result:
```bash
resArr = [
           { animal: 'dog', weight: '20 kg', color: 'black' },
           { animal: 'cat', weight: '5 kg', color: 'white' },
           { animal: 'mouse', weight: '0.15 kg', color: 'gray' }
         ]
```

### 2. Parse excel file by path to array of JSON

```bash
const { parseJson } = require('parseexcel')

const resArr = parseJson(filePath) 
```
### Result:

```bash
resArr = [
           '{"animal":"dog","weight":"20 kg","color":"black"}',
           '{"animal":"cat","weight":"5 kg","color":"white"}',
           '{"animal":"mouse","weight":"0.15 kg","color":"gray"}'
         ]
```
### 3. Parse excel files (1 or more) from directory to array of javaScript objects

Table 1

|  phone  |  price | color |
|---------|-------:|:-----:|
|  Xiaomi | 100 $  |  blue  |
|  Samsung| 150 $  |  white |
|  Nokia  | 50 $   |  black |

Table 2

|      TV     | price  | size  | weight |
|-------------|-------:|:------:|:-----:|
| LG          | 150 $  |  150  |   10   |
| Horizont    | 50 $   | 70    |   12   |
| Panasonic   | 250 $  | 120   |   8    |

Usage:
```bash
const { parseAllObj } = require('parseexcel')

const resArr = parseAllObj(directoryPath) 
```
    
### Result:

```bash
resArr = [
           [
             { phone: 'Xiaomi', price: '100 $', color: 'blue' },
             { phone: 'Samsung', price: '150 $', color: 'white' },
             { phone: 'Nokia', price: '50 $', color: 'black' }
           ],
           [
             { TV: 'LG', price: '150 $', size: 150, weight: 10 },
             { TV: 'Horizont', price: '50 $', size: 70, weight: 12 },
             { TV: 'Panasonic', price: '250$', size: 120, weight: 8 }
           ]
         ]
```    
### 4. Parse excel files (1 or more) from directory to array of JSON

```bash
const { parseAllJson } = require('parseexcel')

const resArr = parseAllJson(directoryPath) 
   ```

### 5. Parse Async excel files (1 or more) from directory to array of javaScript objects
```bash
const { parseAllObjAsync } = require('parseexcel')

const resArr = await parseAllObjAsync(directoryPath) 
```
### 6. Parse Async excel files (1 or more) from directory to array of JSON

```bash
const { parseAllJsonAsync } = require('parseexcel')

const resArr = await parseAllJsonAsync(directoryPath) 
```

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