csv-parser
Our great sponsors
csv-parser | website-thomas-astro | |
---|---|---|
9 | 6 | |
1,399 | 42 | |
- | - | |
0.0 | 8.9 | |
3 months ago | 25 days ago | |
JavaScript | MDX | |
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
csv-parser
-
Basic analytics with Vercel Postgres, Drizzle & Astro
Inside the API route, convert the CSV file to JSON with csv-parser
-
Why my favourite API is a zipfile on the European Central Bank's website
https://github.com/mafintosh/csv-parser/pull/121 https://github.com/mafintosh/csv-parser/pull/151 https://github.com/mafintosh/csv-parser/issues/218
The author of the library probably has learned, the hard way many many lessons (and probably also decided to prioritize some of the requested issues / feature requests along the way).
The above is not meant as a ding on the project itself and I am sure it is used successfully by many people. The point here is that your claim that you can easily write a csv parser in 200 lines of code does not hold water. It's anything but easy and you should use a battle tested library and not reinvent the wheel.
-
I have created a nextjs app which has multiple card column, i want to import data from csv file to this card. can somebody guide me? for reference i have attached some image what i want
If this were me, I'd probably add a getStaticProps function to the page, and then use the csv-parser library within this function to convert the CSV file into JSON data, and then return that JSON data from the getStaticProps function so the page can access it as props.
-
Node.js - Streams and Promises
I started with using the external library csv-parser. However, since it is basically a wrapper around the base Node.js technologies I listed above I has the same problems working with my data that I will list below. I eventually uninstalled it and wrote my own light-weight version.
-
Working with CSVs in Node.JS
I have found this CSV parser package and it almost works exactly like I need it. I've ran into 2 issues.
- Parsing large datasets into memory or database
-
Effecient way for creating partition in large file to feed in to a node worker thread
I was using the [csv-parser](https://github.com/mafintosh/csv-parser) library to handle csv parsing in node. The file can be huge ranging from 50,000 to 500,000 lines, maybe even larger. I had to perform some computations on the csv, after this is submitted to the server for that I was thinking of dividing the csv into chunks which I could then provide to worker threads for performing the computation. The worker thread would get the number of lines to skip and then start reading the lines after that up to a particular limit. I create a read stream and pass the csv-parser in with the option of number of lines to skip. I tried to perform some benchmarks on it but could find no visible benefits between skipping lines and not skipping lines. Even if I read the whole file it was sometimes faster than reading the ending 30,000 lines.
- Can this problem be fixed with JS?
website-thomas-astro
-
Astro DB: Migrating my analytics data from Vercel Postgres
Since Drizzle abstracts away the differences between Postgres & LibSQL behind the scenes, I didn't have to change much to my queries. This made the migration very easy. Having the type-safety of Drizzle, I could just do the changes and do a quick type-check to see if any TS errors popped up, if there weren't any, I was done. Now the migration's done, I don't have to worry about hitting the limits of the free tier anywhere soon, and the DX got even better, double win! If you want to see the changes I had to do to move from Vercel Postgres to Astro DB in code, you can check this compare. You'll see a lot of the changed files are from moving my pages/page-views route to a static route, and handling all the data fetching for it on the client side. This was mainly done to avoid seeing an empty page for too long while server rendering the dataset.
-
Basic analytics with Vercel Postgres, Drizzle & Astro
Full code can be found on GitHub, live data can be seen on my website.
-
Setting up authentication in Astro with Prisma and Planetscale
Hope this was helpful! Source code can be found on my Github as always.
-
Automatically generating pages for each tag used in Astro with MDX
I must say I really enjoy working with Astro for writing Markdown/MDX, especially when they make it this easy! Source code can be found on Github. An example of a tag page can be found here.
-
Adding Vercel og:image generation to Astro project with Edge functions
Hopefully this helps other people wanting to use serverless/edge API functions in their Astro projects. Source code can be found here.
-
Adding comments to my Astro blog with PlanetScale & Prisma on Vercel Edge
To make my code run locally too, I needed to change the DATABASE_URL environment variable to make it point directly to PlanetScale instead of going through Prisma Proxy. Go check it out on my blog, and add a comment ;-). Source code can be found on my Github.
What are some alternatives?
xlsx-populate - Excel XLSX parser/generator written in JavaScript with Node.js and browser support, jQuery/d3-style method chaining, encryption, and a focus on keeping existing workbook features and styles in tact.
vercel-action - This action make a deployment with github actions instead of Vercel builder.
PEG.js - PEG.js: Parser generator for JavaScript
Prisma - Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
parse-json - Parse JSON with more helpful errors
astro - The web framework for content-driven websites. ⭐️ Star to support our work!
google-libphonenumber - The up-to-date and reliable Google's libphonenumber package for node.js.
neat-csv - Fast CSV parser
Jison - Bison in JavaScript.
Chevrotain - Parser Building Toolkit for JavaScript
xml2js - XML to JavaScript object converter.
URI.js - Javascript URL mutation library