# parse-my-file

> Give your file and a simple configuration to Parse My File and let it do all of the work for you

Latest version **1.1.2** (published 2023-10-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install parse-my-file
pnpm add parse-my-file
yarn add parse-my-file
bun add parse-my-file
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2023-10-21 |
| First published | 2023-10-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Joseph Bartley |
| Maintainers | josephdanielbartley |
| Keywords | parse, parser, csv, tsv, txt |

## Links

- npm: https://www.npmjs.com/package/parse-my-file
- Repository: https://github.com/josephbartley/parse-my-file
- Homepage: https://github.com/josephbartley/parse-my-file#readme
- Issues: https://github.com/josephbartley/parse-my-file/issues
- npm.io page: https://npm.io/package/parse-my-file

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 1.1.2 (latest) — 2023-10-21
- 1.1.1 — 2023-10-18
- 1.1.0 — 2023-10-18
- 1.0.1 — 2023-10-15
- 1.0.0 — 2023-10-15

## README

# Parse-My-File

## Configuration

```TypeScript
{
    // the character that separates columns
    delimiter: ',',
    // OPTIONAL: the javascript object shape to get from each row
    //// the value of each key is the header value of each column 
    //// if not provided, a basic shape will be provided for you
    shape: {
        id: 'ID',
        name: 'NAME',
        pricing: {
            price: 'PRICE',
            quantity: 'QTY'
        }
    }
}
```

## Usage

```csv
ID, NAME, PRICE, QTY
1, A THING, $0.99, 5
```

```TypeScript
import { parseMyFile } from 'parse-my-file'

const result = parseMyFile('test.txt', {
    delimiter: ',',
    shape: {
        id: 'ID',
        name: 'NAME',
        pricing: {
            price: 'PRICE',
            quantity: 'QTY',
        }
    }
})

console.log('result', result)
// [ { id: '1', name: 'A THING', pricing: { price '$0.99', quantity: '5' } } ]

// Alternatively, if you choose to not provide a shape
// it will default to using the header value as the keys
// [ { ID: '1', NAME: 'A THING', PRICE: '$0.99', QTY: '5' } ]
```

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