Adapter that lets Integreat parse and stringify CSV.
Requires node v20 and Integreat v1.0.
Install from npm:
npm install integreat-adapter-csv
Example of use:
import Integreat from 'integreat'
import httpTransporter from 'integreat-transporter-http'
import cvsAdapter from 'integreat-adapter-csv'
import defs from './config.js'
const great = Integreat.create(defs, {
transporters: { http: httpTransporter },
adapters: { csv: csvAdapter },
})
// ... and then dispatch actions as usual
Example service configuration:
{
id: 'csvfile',
transporter: 'http',
adapters: ['csv'],
endpoints: [
{ options: { delimiter: ';' } }
]
}
delimiter
: Specify what character to use as a delimiter between fields. Default is comma,
.quoted
: Whentrue
, values will be surrounded by quotes. Default istrue
.headerRow
: Whentrue
, a header row will be included at as the first row. Object keys will be used as header values. Default isfalse
.
The tests can be run with npm test
.
Please read CONTRIBUTING for details on our code of conduct, and the process for submitting pull requests.
This project is licensed under the ISC License - see the LICENSE file for details.