
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@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
113.0.0 (2023-03-13)
FAQs
sheets
The npm package @googleapis/sheets receives a total of 127,830 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 2 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.