https://github.com/siman/csv-upload
Use HTML5 File.slice() to read CSV file on a client and send bulk of lines to server until entire file is read.
https://github.com/siman/csv-upload
csv html5 html5-fileapi js nodejs react
Last synced: 11 months ago
JSON representation
Use HTML5 File.slice() to read CSV file on a client and send bulk of lines to server until entire file is read.
- Host: GitHub
- URL: https://github.com/siman/csv-upload
- Owner: siman
- Created: 2017-03-15T13:53:03.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-15T14:51:17.000Z (about 9 years ago)
- Last Synced: 2025-02-17T11:43:18.807Z (about 1 year ago)
- Topics: csv, html5, html5-fileapi, js, nodejs, react
- Language: JavaScript
- Homepage:
- Size: 314 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CSV upload
Client app uses HTML5 `File.slice()` to read CSV file on a client and send bulk of lines to server
until entire file has been read.

## Storage
On server we use **SQLite3** to store and retrieve saved user records.
App can work with both in-file or in-memory version of SQLite. To change a storage type go to file
[./db.js](./db.js) and change a block of code in `function createDb(...)`:
```js
} else {
createDbInFile(onDbCreatedFn); // Inserting users to in file DB is veeeery slooow. About 30 ops/s.
//createDbInMemory(onDbCreatedFn); // Insert into memory is a way faster.
}
```
## Install
```bash
npm i
```
## Test
```bash
./test.sh
```
## Run a web app
```bash
./prod_build_run.sh
```
Then open in a browser http://localhost:3000
## Generate CSV files?
Need to generate sample CSV files?
### Generate CSV with 20K lines of user data:
```bash
node gen-20K-lines-csv.js
```
### Generate 10MB CSV:
```bash
node gen-10MB-csv.js
```
### or even 1GB CSV:
It will take some time. Be patient.
```bash
node gen-1GB-csv.js
```