Package Exports
- express-export
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (express-export) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Express Export
Installation
npm i express-export
# or
yarn add express-exportExample
Root file
const server = express();
ExpressExport.applyMiddleware(server);Add router
const data = [
{ user: "Maxim", age: 22, location: "Moscow" },
{ user: "Valentina", age: 18 }
];
const fields = ["user", "age"];
server.get("/", function(req, res, next) {
res.export({
format: req.query.format as ExportFormat, // csv | xml | json
filename: "users",
data,
fields,
download: false
});
});