
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.
@googleapis/sheets
Advanced tools
@googleapis/sheets is an npm package that provides a client library for accessing the Google Sheets API. It allows developers to interact with Google Sheets programmatically, enabling them to read, write, and manipulate spreadsheet data.
Read Data from a Spreadsheet
This feature allows you to read data from a specified range in a Google Sheets spreadsheet. The code sample demonstrates how to use the Google Sheets API to fetch data from a specific range in a sheet.
const { google } = require('@googleapis/sheets');
const sheets = google.sheets('v4');
async function readData(auth) {
const request = {
spreadsheetId: 'your-spreadsheet-id',
range: 'Sheet1!A1:D5',
auth: auth,
};
try {
const response = await sheets.spreadsheets.values.get(request);
console.log(response.data.values);
} catch (err) {
console.error(err);
}
}
Write Data to a Spreadsheet
This feature allows you to write data to a specified range in a Google Sheets spreadsheet. The code sample demonstrates how to use the Google Sheets API to update a range of cells with new data.
const { google } = require('@googleapis/sheets');
const sheets = google.sheets('v4');
async function writeData(auth) {
const request = {
spreadsheetId: 'your-spreadsheet-id',
range: 'Sheet1!A1',
valueInputOption: 'RAW',
resource: {
values: [
['Item', 'Cost'],
['Apple', '$1'],
['Banana', '$2'],
],
},
auth: auth,
};
try {
const response = await sheets.spreadsheets.values.update(request);
console.log(response.data);
} catch (err) {
console.error(err);
}
}
Append Data to a Spreadsheet
This feature allows you to append data to a specified range in a Google Sheets spreadsheet. The code sample demonstrates how to use the Google Sheets API to add new rows of data to a sheet.
const { google } = require('@googleapis/sheets');
const sheets = google.sheets('v4');
async function appendData(auth) {
const request = {
spreadsheetId: 'your-spreadsheet-id',
range: 'Sheet1!A1',
valueInputOption: 'RAW',
insertDataOption: 'INSERT_ROWS',
resource: {
values: [
['Orange', '$3'],
['Grapes', '$4'],
],
},
auth: auth,
};
try {
const response = await sheets.spreadsheets.values.append(request);
console.log(response.data);
} catch (err) {
console.error(err);
}
}
The google-spreadsheet package is another popular library for interacting with Google Sheets. It provides a simpler interface for reading and writing data to Google Sheets. Compared to @googleapis/sheets, it abstracts away some of the complexities of the Google Sheets API, making it easier to use for basic operations.
The gsheets package is a lightweight library for accessing Google Sheets. It offers basic functionalities for reading and writing data. While it is not as feature-rich as @googleapis/sheets, it is suitable for simple use cases and quick integrations.
Reads and writes Google Sheets.
$ npm install @googleapis/sheets
All documentation and usage information can be found on GitHub. Information on classes can be found in Googleapis Documentation.
This library is licensed under Apache 2.0. Full license text is available in LICENSE.
We love contributions! Before submitting a Pull Request, it's always good to start with a new issue first. To learn more, see CONTRIBUTING.
Crafted with ❤️ by the Google Node.js team
145.0.0 (2024-10-30)
FAQs
sheets
The npm package @googleapis/sheets receives a total of 127,458 weekly downloads. As such, @googleapis/sheets popularity was classified as popular.
We found that @googleapis/sheets demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.