0.1.8 • Published 1 month ago

@hckrnews/object-converter v0.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

object-converter

Usage:

import makeConverter from '@hckrnews/object-converter'

const converter = makeConverter({ fields })
const result = converter({ data, type: 'csv', outputType: 'buffer', subField: 'quantities', subItems: 'battery' })

You can set some fields with a name and what field(s) it should return. And then you can send some data to the converter. (array of objects)

Fields:

{
    name: 'Order number',
    field: data => `${data.order_id} / ${data.order_row_id_parsed}`
}

Data:

[
  {
    order_id: 42,
    ...
  }
]

Types: json, csv, xlsx

Output types: buffer (e.g. express), string, array, ... (https://github.com/SheetJS/sheetjs#output-type)

0.1.8

1 month ago

0.1.7

2 months ago

0.1.4

6 months ago

0.1.6

5 months ago

0.1.5

6 months ago

0.1.3

12 months ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago