# efonelfo

> JavaScript library for parsing and writing EfoNelfo v4.0 documents.

Latest version **0.0.17** (published 2018-05-09) · MIT license · 0 weekly downloads

## Install

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

## 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.17 |
| Published | 2018-05-09 |
| First published | 2017-05-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 7.10.0 |
| Dependencies | 2 |
| Unpacked size | 21.5 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | trym |

## Links

- npm: https://www.npmjs.com/package/efonelfo
- Repository: https://github.com/skalar/efonelfo
- npm.io page: https://npm.io/package/efonelfo

## Dependencies (2)

- [csv-parse](https://npm.io/package/csv-parse.md) ^2.4.0
- [iconv-lite](https://npm.io/package/iconv-lite.md) ^0.4.23

## Recent versions

- 0.0.17 (latest) — 2018-05-09
- 0.0.16 — 2018-05-09
- 0.0.15 — 2018-05-09
- 0.0.14 — 2017-07-05
- 0.0.13 — 2017-07-05
- 0.0.12 — 2017-07-04
- 0.0.10 — 2017-07-02
- 0.0.9 — 2017-06-23
- 0.0.8-beta.5 — 2017-06-23
- 0.0.8-beta.4 — 2017-06-23
- 0.0.8-beta.3 — 2017-06-23
- 0.0.8-beta.2 — 2017-06-23
- 0.0.8-beta — 2017-06-23
- 0.0.7 — 2017-06-23
- 0.0.6 — 2017-06-23
- … 5 more at https://npm.io/package/efonelfo/versions

## README

# EfoNelfo

JavaScript library for parsing and writing EfoNelfo v4.0 documents.

* Supported formats:
  * CSV
* Supported types:
  * BH/BL Varebestilling
  * VH/VL Vareformat
  * RH/RL Rabatt
* Official documentation: http://www.efo.no/wp-content/uploads/2017/04/EFONELFO40-PDF.zip

## Installation

`npm install efonelfo`

## Examples

### Parse CSV file

```js
import {parseCSVFile} from 'efonelfo'
const [bh] = await parseCSVFile('B42.123.csv')

console.log(bh.KundeNr)
```

### Parse CSV string

```js
import {parseCSV} from 'efonelfo'
const csv ='BH;EFONELFO;4.0;;NO950349875MVA;2091;28579;;;19271;;19271;;;;;;;2091/19271;;;;20100602;;;;;;;;;;;;;;;;;;;;;;;;;;'
const [bh] = await parseCSV(csv)
```

### Working with objects

```js
import {PostTypes, toCSV} from 'efonelfo'
const {BH, BL} = PostTypes
const bh = BH({
  KjøpersId: '11233',
  BestNr: '231444',
  LevDato: new Date('2012-06-21')
})

bh.EksternRef = 'my reference'
bh.push({PostType: 'BL', LinjeNr: '1', Ant: 3, PrisEnhet: 'EA', DelLev: true})
bh.push(BL({LinjeNr: '2', Ant: 10, VareNr: '12345'}))

// Generate CSV
console.log(toCSV(bh))

/* Result:
BH;EFONELFO;4.0;;11233;231444;;;;;;;;;;;my reference;;;;;;20120621;;;;;;;;;;;;;;;;;;;;;;;;;;
BL;1;;;;;;300;EA;;;;J;J
BL;2;;;12345;;;1000;;;;;J;J
*/
```

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