0.0.17 • Published 6 years ago

efonelfo v0.0.17

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

EfoNelfo

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

Installation

npm install efonelfo

Examples

Parse CSV file

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

console.log(bh.KundeNr)

Parse CSV string

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

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
*/
0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8-beta.5

7 years ago

0.0.8-beta.4

7 years ago

0.0.8-beta.3

7 years ago

0.0.8-beta.2

7 years ago

0.0.8-beta

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago