
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@ayyyub/sheet2json
Advanced tools
sheet2json is a Node.js package that allows you to easily convert data from Google Sheets into JSON format. With this package, you can fetch spreadsheet data, where column headers are used as keys in the resulting JSON objects, making it simple to work with structured data from Google Sheets.
To install sheet2json, you can use npm:
npm install @ayyyub/sheet2json
First, ensure you have a valid access token for the Google Sheets API. You can obtain this token by following the authentication steps in the Google Sheets API documentation.
Here is an example of how to use the sheet2json package:
const sheet2json = require("@ayyyub/sheet2json");
const sheet = new sheet2json(
"YOUR_ACCESS_TOKEN_HERE"
);
async function main() {
try {
const data = await sheet.get("YOUR_SPREADSHEET_ID_HERE");
console.log(data);
} catch (error) {
console.error("Error fetching data:", error);
}
}
main();
get(spreadsheetId: string): Fetches spreadsheet data and converts it to JSON format.
The get method returns a promise that resolves to an object containing JSON data for each sheet in the specified spreadsheet. Each key corresponds to a sheet name, and its value is an array of objects representing rows in that sheet, with column headers as keys.
Assuming you have a Google Spreadsheet with the following structure:
| Name | Age | Active |
|---|---|---|
| Alice | 30 | true |
| Bob | 25 | false |
Using the above code, the output would look like this:
{
"Sheet1": [
{ "Name": "Alice", "Age": 30, "Active": true },
{ "Name": "Bob", "Age": 25, "Active": false }
]
}
If there is an error accessing the spreadsheet or if the data is invalid, an error will be thrown with a descriptive message. Make sure to handle these errors appropriately in your application.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please submit a pull request or open an issue to discuss improvements or new features.
FAQs
Convert Google Sheets data to JSON
We found that @ayyyub/sheet2json 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.