
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
node-json-xlsx
Advanced tools
utility to convert json to a excel file, based on Node-Excel-Export
npm install node-json-xlsx
Use to save as file:
var json2xlsx = require('node-json-xlsx');
var json = {
foo: 'bar',
qux: 'moo',
poo: 123,
stux: new Date()
}
var xlsx = json2xlsx(json);
fs.writeFileSync('data.xlsx', xlsx, 'binary');
As a second parameter to json2xlsx or a third parameter to res.xlsx, a map of options can be passed:
var xlsx = json2xlsx(json, options);
res.xlsx('data.xlsx', jsonArr, options);
The following options are supported:
- style: a styles xml file, see <https://github.com/functionscope/Node-Excel-Export>
- fields: either an array or map containing field configuration:
- array: a list of names of fields to be exported, in that order
- object: a map of names of fields to be exported and the types of those fields. Supported types are 'number','string','bool'
Example:
var json2xlsx = require('node-json-xlsx');
var json = {
foo: 'bar',
qux: 'moo',
poo: 123,
stux: new Date()
}
//export only the field 'poo'
var xlsx = json2xlsx(json,{
fields: ['poo']
});
//export only the field 'poo' as string
var xlsx = json2xlsx(json,{
fields: {poo:'string'},
fieldNames: ['Poo']
});
fs.writeFileSync('data.xlsx', xlsx, 'binary');
FAQs
canonically transform json to an excel document
The npm package node-json-xlsx receives a total of 904 weekly downloads. As such, node-json-xlsx popularity was classified as not popular.
We found that node-json-xlsx 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
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.