
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
google-spreadsheet
Advanced tools
Google Sheets API (v4) -- simple interface to read/write data and manage sheets
The google-spreadsheet npm package allows you to interact with Google Sheets through the Google Sheets API. It provides a simple and intuitive way to read, write, and manage Google Sheets data programmatically.
Authentication
This feature allows you to authenticate with the Google Sheets API using either service account credentials or OAuth2 tokens.
const { GoogleSpreadsheet } = require('google-spreadsheet');
const doc = new GoogleSpreadsheet('<spreadsheet-id>');
// Using service account credentials
await doc.useServiceAccountAuth(require('./path/to/credentials.json'));
// OR using OAuth2 tokens
await doc.useOAuth2Client(oAuth2Client);
Loading a Spreadsheet
This feature allows you to load the spreadsheet's metadata and worksheets, making it possible to interact with the spreadsheet's structure and data.
await doc.loadInfo(); // loads document properties and worksheets
console.log(doc.title);
Reading Rows
This feature allows you to read rows from a specific sheet within the spreadsheet. You can access individual cell values and iterate through the rows.
const sheet = doc.sheetsByIndex[0]; // or use doc.sheetsById[id]
const rows = await sheet.getRows(); // can pass in { limit, offset }
console.log(rows[0].name);
Adding Rows
This feature allows you to add new rows to a sheet within the spreadsheet. You can specify the values for each column in the new row.
await sheet.addRow({ name: 'John Doe', email: 'john.doe@example.com' });
Updating Cells
This feature allows you to update the values of specific cells in a row and save the changes back to the spreadsheet.
const row = rows[0];
row.name = 'Jane Doe';
await row.save();
The googleapis package is a comprehensive library for interacting with various Google APIs, including the Google Sheets API. It provides more extensive functionality beyond just Google Sheets, but it requires more setup and configuration compared to google-spreadsheet.
The gsheets package is a lightweight library for accessing Google Sheets data. It offers basic functionalities for reading and writing data but lacks some of the advanced features and ease of use provided by google-spreadsheet.
The g-sheets-api package is designed for simple and quick access to Google Sheets data. It is less feature-rich compared to google-spreadsheet but can be a good choice for straightforward use cases where minimal setup is desired.
17 August 2020
#380
#358
#349
#319
#320
#324
d2fbc5c
4ae02d9
626581b
37084fd
5c24469
1e30921
c0e4b5f
301dfa9
FAQs
Google Sheets API -- simple interface to read/write data and manage sheets
The npm package google-spreadsheet receives a total of 152,774 weekly downloads. As such, google-spreadsheet popularity was classified as popular.
We found that google-spreadsheet demonstrated a healthy version release cadence and project activity because the last version was released less than 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.