ImportKit
npm package · v1.0.0
File imports that can pick up where they stopped.
ImportKit 1.0.0 reads CSV and JSON Lines from local files or HTTP. It validates records, groups them into batches and saves confirmed progress. Stable record IDs let the destination recognise a delivery it has already processed.
const result = await importFile({
source: fileSource('./orders.csv'),
reader: csvReader(),
importId: 'orders-november',
transformVersion: 'orders-v1',
checkpointStore: fileCheckpointStore('./orders.checkpoint.json'),
batchSize: 1000,
maxBatchBytes: 1024 * 1024,
mapRecord: encodeOrder,
measureRecordBytes: (value) => value.byteLength,
commitBatch: persistEncodedOrders,
});Integration excerpt. encodeOrder validates and encodes each order as a Buffer; persistEncodedOrders persists the values idempotently. Both functions belong to the application. The measurement counts Buffer bytes, not process memory.