
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
spreadsheets-reader
Advanced tools
format excel/csv/ods files into standard js objects on upload into browser
async function accepts a FileList (event.target.files) and returns ready-to-code javascript objects
xlsx d3-dsvnpm install spreadsheets-reader
async function onChangeHandler(event) {
let filelist = event.target.files;
let spreadsheeets = await SpreadSheetsFileReader(
filelist,
["NA", "N/A"], //values converted to empty string, defaults shown
"#" //ignore rows starting with string, default shown
);
const firstFile = spreadsheeets[0];
const firstSheet = firstFile[0];
const { filename, sheetname, data } = firstSheet;
}
import { SpreadSheetsFileReader } from "spreadsheets-reader";
import { ChangeEvent, useState } from "react";
import { FolderType } from "spreadsheets-reader/dist/tsc/types";
function App() {
const [spreadsheets, setSpreadsheets] = useState<FolderType>([]);
async function handleUpload(e: ChangeEvent<HTMLInputElement>) {
const target = e.target;
if (!target.files?.length) return;
let filelist: FileList = target.files;
let spreadsheeets = await SpreadSheetsFileReader(filelist);
setSpreadsheets(spreadsheeets);
}
return (
<div>
<input
type="file"
multiple
onChange={handleUpload}
accept=".csv, .xlsx, .xlsb, .xls, .ods"
></input>
{spreadsheets.length && (
<pre>{JSON.stringify(spreadsheets, null, 2)}</pre>
)}
</div>
);
}
export default App;
spreadsheets outputdata attribute is d3-dsv's type DSVRowArray<String>
myFile.xlsx with two sheets
[
[
{
"filename": "myFile.xlsx"
"sheetname": "Sheet1",
"data": [
{
"col1": "10",
"col2": "a",
"col3": "d",
},
{
"col1": "20",
"col2": "b",
"col3": "e",
},
],
},
{
"filename": "myFile.xlsx"
"sheetname": "Sheet2",
"data": [
{
"colA": "1",
"colB": "a",
"colC": "d",
"colD": "g"
},
{
"colA": "2",
"colB": "b",
"colC": "e",
"colD": "h"
},
],
}
]
]
FAQs
format excel/csv/ods files into standard js objects on upload into browser
We found that spreadsheets-reader 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.