Pi Zero Easy IoT

安価で簡単に IoT を始めよう! - Raspberry Pi Zero によるプログラミングレス IoT 環境データ収集

csv.js

Libray for creating and writing (adding) some data to csv file, this module exports class Csv.

Csv class (extends Record class)

Usage example

let Csv = require('file path to this csv.js');

let csv = new Csv({
    path: 'result.csv',
    order: ,
    date: ,
    dateFormat: 
});

csv.write({a: 1, b: 2});
csv.write({a: 3, b: 4});
csv.write({a: 5, b: 6});

Finally result.csv is like this.

a,b
1,2
3,4
5,6

Constructor & Method

path is a path to output csv file. order is an array of object (write method argument) keys. date is dateFormat