UNPKG

s3-csv-to-json

Version:

Converts AWS S3 files from CSV to JSON lines via stream with support to gzip for both input and output. Ready to be used as a Node.js module, as a Lambda or via CLI.

12 lines (10 loc) 329 B
const s3CsvToJson = require('./s3-csv-to-json.js'); async function handler({ input, output }) { try { const body = await s3CsvToJson({ input, output }); return { statusCode: 200, body }; } catch (err) { return { statusCode: err.statusCode || 400, body: err }; } }; exports.handler = handler;