
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
s3-csv-to-json
Advanced tools
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.
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.
Currently it downloads the input file from S3 and upload the result back to it. A support to have one of the both ends pointing to a local file will be worked on.
npm install s3-csv-to-json
Clone the repo and install its dependencies without optionals, as aws-sdk
is already available on Lambda functions.
npm install --no-optional
After installing all dependencies, package it as a zip (e.g. zip -r s3-csv-to-json.zip s3-csv-to-json/*
).
Lambda config:
Using it as a module, a Lambda or via CLI, it just expects an input and a output path from AWS S3.
{
"input": "https://s3.amazonaws.com/bucket-name/path/to/input.csv.gz",
"output": "s3://bucket-name/path/to/output.jsonl.gz"
}
As shown above, S3 protocol is accepted as well for both cases (e.g. s3://bucket-name/path/to/input.csv).
Gzip is supported for both input and output. The .gz extension is all that is needed to determine when the input must be decompressed and if the output should be compressed. If there is no .gz extension it will be handled as a text file (UTF-8).
const s3CsvToJson = require('s3-csv-to-json.js');
// Assuming that the following is within an async function
const response = await s3CsvToJson({
input: "https://s3.amazonaws.com/bucket-name/path/to/input.csv.gz",
output: "s3://bucket-name/path/to/output.jsonl.gz"
});
Just post a JSON as already shown above:
{
"input": "https://s3.amazonaws.com/bucket-name/path/to/input.csv.gz",
"output": "s3://bucket-name/path/to/output.jsonl.gz"
}
Clone the repo and execute it using the module MagiCLI via npx
:
npx magicli ./path-to-s3-csv-to-json-module --input="s3://bucket-name/path/to/input.csv.gz" --output="s3://bucket-name/path/to/output.jsonl.gz"
CSV Input:
ID,NAME
1,John Doe
2,Jane Doe
JSON lines output:
{"ID":"1","NAME":"John Doe"}
{"ID":"2","NAME":"Jane Doe"}
FAQs
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.
The npm package s3-csv-to-json receives a total of 4 weekly downloads. As such, s3-csv-to-json popularity was classified as not popular.
We found that s3-csv-to-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.