Skip to content

Use HTML5 File.slice() to read CSV file on a client and send bulk of lines to server until entire file is read.

Notifications You must be signed in to change notification settings

siman/csv-upload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Webapp screenshot: Uploading a CSV

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 and change a block of code in function createDb(...):

} 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

npm i

Test

./test.sh

Run a web app

./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:

node gen-20K-lines-csv.js

Generate 10MB CSV:

node gen-10MB-csv.js

or even 1GB CSV:

It will take some time. Be patient.

node gen-1GB-csv.js

About

Use HTML5 File.slice() to read CSV file on a client and send bulk of lines to server until entire file is read.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages