项目作者: siman

项目描述 :
Use HTML5 File.slice() to read CSV file on a client and send bulk of lines to server until entire file is read.
高级语言: JavaScript
项目地址: git://github.com/siman/csv-upload.git
创建时间: 2017-03-15T13:53:03Z
项目社区:https://github.com/siman/csv-upload

开源协议:

下载


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(...):

  1. } else {
  2. createDbInFile(onDbCreatedFn); // Inserting users to in file DB is veeeery slooow. About 30 ops/s.
  3. //createDbInMemory(onDbCreatedFn); // Insert into memory is a way faster.
  4. }

Install

  1. npm i

Test

  1. ./test.sh

Run a web app

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

  1. node gen-20K-lines-csv.js

Generate 10MB CSV:

  1. node gen-10MB-csv.js

or even 1GB CSV:

It will take some time. Be patient.

  1. node gen-1GB-csv.js