-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtest.js
37 lines (29 loc) · 810 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Load the csv-parser
var csv = require('./lib/csv.js')
var smallData = './sample_data/sample.csv'
var BigData = './sample_data/Fielding.csv'
//Synchronous Parsing
// var syncR = csv.parseSync(smallData)
// console.log(syncR)
//ASynchronous Parsing
var aSyncR = csv.parseAsync(smallData)
// console.log(aSyncR)
// csv.parseAsync(url, function(error, data){
// if (error)
// throw error
// console.log(data)
// })
// fs.createReadStream('path/to/data.csv')
// .pipe(csv.parsePipe())
// .pipe(fs.createWriteStream('path/to/data.txt'))
// var p = csv.parseObject(url)
// p.on('data', function(data){
// console.log('got some data:' + data)
// })
// p.on('end', function(){
// console.log('no more data')
// })
// p.on('error', function(err){
// alert('something error' + err)
// })
// p.run()