
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
express-csv
Advanced tools
_____ ____ ______ __
| ____|_ ___ __ _ __ ___ ___ ___ / ___/ ___\ \ / /
| _| \ \/ / '_ \| '__/ _ \/ __/ __| | | \___ \\ \ / /
| |___ > <| |_) | | | __/\__ \__ \ | |___ ___) |\ V /
|_____/_/\_\ .__/|_| \___||___/___/ \____|____/ \_/
|_|
Express CSV provides response CSV easily to Express.
npm:
$ npm install express-csv
Example:
var express = require('express')
, csv = require('express-csv')
, app = module.exports = express.createServer();
app.get('/', function(req, res) {
res.csv([
["a", "b", "c"]
, ["d", "e", "f"]
]);
});
app.listen(3000);
Response:
$ curl --verbose http://127.0.0.1:3000/
* About to connect() to 127.0.0.1 port 3000 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 3000 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: 127.0.0.1:3000
> Accept: */*
>
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Content-Type: text/csv; charset=utf-8
< Content-Length: 26
< Connection: keep-alive
<
"a","b","c"
"d","e","f"
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0
Alternatively, you can also pass an array of objects to be serialized, in which case the object's properties will be iterated over. E.g.:
res.csv([ { name: "joe", id: 1 }]
//=> "joe", 1
The MIT License
Copyright (c) 2012 Seiya Konno <nulltask@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
express-csv provides response csv easily to express.
The npm package express-csv receives a total of 1,902 weekly downloads. As such, express-csv popularity was classified as popular.
We found that express-csv demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.