koa-csv
CSV files serving as json API middleware for koa
Usage Example
const Koa = const app = app
root
root directory stringopts
option object
Request Example
for test.csv
like this
Name | Value |
---|---|
name | value |
GET /test.csv
GET /test.csv?axis=col
Options
trim
whether or not trim each cell, defaulttrue
axis
default isrow
, csv will be converted to an array of objects representing each line in csv, ifaxis
iscol
, csv will be converted to an object, each property representing column in csvdelimiter
csv delimiter, default,
prefix
set the prefix of request path to matchlsdir
enable lsdir if path is a dir, default false
TODO
- gzip support