Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/victorbadaro/node-csv-reader-example
This is an example app that was made to try CSV file reading
https://github.com/victorbadaro/node-csv-reader-example
csv csv-parser dotenv express expressjs file-upload multer node node-js nodejs typescript
Last synced: about 16 hours ago
JSON representation
This is an example app that was made to try CSV file reading
- Host: GitHub
- URL: https://github.com/victorbadaro/node-csv-reader-example
- Owner: victorbadaro
- Created: 2023-09-06T01:33:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-08T12:52:26.000Z (over 1 year ago)
- Last Synced: 2024-12-02T23:13:10.342Z (about 2 months ago)
- Topics: csv, csv-parser, dotenv, express, expressjs, file-upload, multer, node, node-js, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-csv-reader-example
[![LEIAME.md](https://img.shields.io/badge/-Leia%20em%20Portugu%C3%AAs-brightgreen?style=for-the-badge)](./LEIAME.md)
## Summary
- [π§Ύ About](#-about)
- [π Main technologies](#-main-technologies)
- [π» Usage](#-usage)
- [π Requests](#-requests)## π§Ύ About
This is an example app that was made to try CSV file reading. You can make [requests](#-requests) to list users, create users and (of course) import users from a CSV file.## π Main technologies
- [Node.js](https://nodejs.org/)
- [Express](https://expressjs.com/)
- [Multer](https://github.com/expressjs/multer)
- [CSV Parse](https://csv.js.org/parse/)
- [Typescript](https://www.typescriptlang.org/)_(You can see all the dependencies in the [package.json](./package.json) file)_
## π» Usage
1. Clone the project (you'll need a [personal access token](https://docs.github.com/pt/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls)):
```bash
$ git clone https://github.com/victorbadaro/node-csv-reader-example
```2. Access its directory:
```bash
$ cd node-csv-reader-example
```3. Install its dependencies:
```bash
$ yarn
# feel free to use another package manager, but you might want use yarn once there's already a yarn.lock file in the root directory
```4. Create a `.env` file in the root directory with the same content that is in the [.env.example](./.env.example) file and fill the variables with your own data:
For example:
![image](https://github.com/victorbadaro/node-csv-reader-example/assets/9096344/2e2d1cce-a7cb-44a3-9b88-6be360ffcf2e)5. Start the server by running the `dev` script:
```bash
$ yarn dev
```## π Requests
Now the server is ready to receive your requests! There's a [request collection](./request-collection.json) in the root directory so you can use (use [insomnia](https://insomnia.rest/) to import the collection). Remember to inform the server port in the `port` environment variable in your rest client software!
Here are the requests you can make:- GET /users
- POST /users
```json
{
"name": "",
"email": ""
}
```
- POST /users/import
> This is a multipart request. Remember to select a CSV file (you can use the [users.csv](./users.csv) file as well)
---This project was created and developed with β€ by Victor BadarΓ³