npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kochtaik/csv-to-json-parser

v1.0.2

Published

This small CSV parser is able to convert valid CSV files into JSON. It is compatible with the most common separators (commas, tabs, semicolons). The parser was made for the learning purposes. Please, don't use it for your projects.

Downloads

4

Readme

Csv to json parser

Short Description

You need to build a command line tool which allows the user to convert CSV files to JSON.

Topics

  • Core Concept
  • Event Loop
  • Globals
  • Modules
  • Streams
  • Async Operations
  • NPM
  • Network

Requirements

You need to build an npm package for parsing CSV files to JSON by implementing a custom NODE.js transform stream with the following abilities:

  1. Set or automatically detect the separator that is used for parsing (use "auto-detect" by default if no separator provided)
  2. Upload result JSON file to Google Drive disk
  3. Provide errors handling for converting process and incorrect command line arguments.

This application should accept following command line arguments using process.argv:

  1. "sourceFile" - path to the csv file that need to be converted.

  2. "resultFile" - path to the result json file.

  3. "separator" - separator that is used while converting.

An example of running the app with command line arguments:

- node csvToJson.js --sourceFile "source.csv" --resultFile "result.json" --separator ","
- node csvToJson.js --sourceFile "source.csv" --resultFile "result.json" --separator " "
- node csvToJson.js --sourceFile "source.csv" --resultFile "result.json"

If you want to upload file to the Google Drive, please, do the following steps:

  1. Get your credentials from the Google Cloud console. They must include client ID, client secret, redirect URL and refresh token. Create a .env file and save them under next variables (respectively): GOOGLE_DRIVE_CLIENT_ID, GOOGLE_DRIVE_CLIENT_SECRET, GOOGLE_DRIVE_REDIRECT_URI, GOOGLE_DRIVE_REFRESH_TOKEN.
  2. Run the script with the argument --uploadToGDrive. The file will appear in your Google Drive, under "JSON-to-CSV parser" folder.

Testing

Write a function that generates at least 10 gigabyte CSV file base on the filled in with mock csv file Generate a CSV file and use it as an source file for your tool. When running the parser pay attention to the RAM that is taken by the process.

Publishing

Add version, name, description, and author of the package in package.json. Publish the package you created to the npm registry.

Advanced Requirements

  1. Implement JSON to CSV parser.