
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
@byetool/json-exporter
Advanced tools
A library that supports exporting json to .xls, .xlsx, .csv, .html, .xml, .json, .txt files in browser
A library that supports exporting json to .xls, .xlsx, .csv, .html, .xml, .json, .txt files in browser.
import exporter from '@byetool/json-exporter'
const data = [
{
id: 1,
title: 'Kinsley High Rise Pop Crop Jeans',
brand: 'AG',
price: '$225.00',
},
{
id: 2,
title: 'Stella Faux Leather Jeans',
brand: 'PAIGE',
price: '$229.00',
},
{
id: 3,
title: 'Rose Jeans',
brand: 'Wandler',
price: '$350.00',
},
]
const filename = 'hello-world'
exporter.toXLSX(data, filename, {
headers: ['title', 'price', 'brand'],
})
7 easy-to-use APIs. Sign as below:
toXLS(data: Obj[], filename: string, options?: Options)
toXLS
- Export json to .xls filetoXLSX
- Export json to .xlsx filetoCSV
- Export json to .csv filetoHTML
- Export json to .html filetoXML
- Export json to .xml filetoJSON
- Export json to .json filetoText
- Export json to .txt fileNOTE: The filename without ext
Here are the available options, except headers, other options come from xlsx
module.
Param | Type | Default | Description |
---|---|---|---|
headers | Header[] | [] | Specify the order and alias of the header, see below |
dateNF | string | 'FMT 14' | Use specified date format in string output |
cellDates | boolean | false | Store dates as type d (default is n ) |
sheetStubs | boolean | false | Create cell objects of type z for null values |
Some usages of headers.
1.Set order only, e.g.
const options = {
headers: ['title', 'price', 'brand'],
}
2.Set alias for header, e.g.
const options = {
headers: [
{ name: 'title', alias: 'Title' },
{ name: 'price', alias: 'Price(USD)' },
{ name: 'brand', alias: 'Brand' },
],
}
3.Choose the fields to output, e.g.
const data = [
{ id: 1, foo: 'hello', bar: 'world' },
{ id: 2, foo: '张三', bar: '李四' },
]
// Output `foo` and `bar` only
const options = {
headers: ['foo', 'bar'],
}
This module is used in Tapicker and works fine.
FAQs
A library that supports exporting json to .xls, .xlsx, .csv, .html, .xml, .json, .txt files in browser
We found that @byetool/json-exporter 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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.