0.1.11 • Published 10 months ago

@hckrnews/object-converter v0.1.11

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months 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.10

1 year ago

0.1.11

10 months ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.4

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.3

2 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago