
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Helper + Middleware for exporting excel files based on sheetjs
npm install excel-help
Include into js app using common js.
const excelHelp = require("excel-help")
Excel Help can be used in two ways.
app.use(excelHelp.middleware);
The middleware accepts data in following format to quickly export a json array) or an array of arrays or both and provides a function res.xlsx to export it as a file / stream.
res.xlsx("export.xlsx",[
{
"type": "json",
"data": [{
"foo":"bar",
"bar":"foo",
"abc":"def"
},
{
"foo":"xyz",
"bar":"lak",
"abc":"mkx"
}]
},
{
"type": "columns",
"data": [
["yqmxc", "kqyui", "zhasi", "kljhda"],
["yqmxl", "kqyuiads", "zhasida", null, new Date()]
]
}
], config?config:{})
![[output.png]]
It accepts an array of objects of folklowing format:
{
"type" : //"json" or "columns",
"data": //the data //Array of objects //Array of arrays,
"options" // options object (Not Mandatory)
}
headerMap - headerMap is an object which can be used to transform the column names. By default the key of the data object is considered as the header.
{headerMap: {"foo":"FOO","bar":"BAR"}}
config may contain the workbook configuration as defined config
const ExcelHelp = require("excel-help");
let excelHelpWb = new ExcelHelp().addSheet(
[
{
"type": "json",
"data": [{
"foo":"bar",
"bar":"foo",
"abc":"def"
},
{
"foo":"xyz",
"bar":"lak",
"abc":"mkx"
}]
},
{
"type": "columns",
"data": [
["yqmxc", "kqyui", "zhasi", "kljhda"],
["yqmxl", "kqyuiads", "zhasida", null, new Date()]
]
}
],
"sheet1", //Name of the sheet (Not Mandatory)
config?config:{} // config object (NotMandatory)
).addSheet(
[
{
"type": "json",
"data": [
{
"foo":"xyz",
"bar":"lak",
"abc":"mkx"
}]
}
],
"sheet2", //Name of the sheet (Not Mandatory)
config?config:{} // config object (NotMandatory)
)
.build()
The method addSheet can be chained any no of times to add muliple sheets to the workbook. addSheet contains a config option which might be used to do operations on the worksheet like changing the width or merging columns.
Changing Column Widths
{"!cols": [ { wch: 10 } ]}
Other examples can be found on sheetjs
The build functions returns the workbook object . The user can then proced to modify the workbook as he needs or write the workbook
Example
excelHelp.XLSX.writeFile(excelHelpWb, filename, write_opts)
FAQs
Helper + Middleware for exporting excel files based on sheetjs
We found that excel-help 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
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.