
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Get public Google Sheets as plain JavaScript/JSON.
:point_right: Try gsheets in your browser
Starting with version 3.0.0, gsheets uses the official Google Sheets API v4, which requires an API key. To get an API key follow these instructions.
Node.js >= 12 is required.
npm install gsheets
const gsheets = require('gsheets');
gsheets.getWorksheet('SPREADSHEET_KEY', 'WORKSHEET_TITLE', 'GSHEETS_API_KEY')
.then(res => console.log(res), err => console.error(err));
gsheets --key --title [--apiKey] [--out] [--pretty] [--dsv]
--key Spreadsheet Key (ID), required
--title Worksheet title, required
--apiKey Google Sheets v4 API key,
--out Output file; defaults to /dev/stdout
--dsv Format as delimiter-separated values
--csv Shortcut for --dsv=,
--tsv Shortcut for --dsv=$'\t'
Supports providing the apiKey via arg:
npx gsheets --key=SPREADSHEETID --title=foobar --apiKey=GSHEETS_API_KEY --pretty
or via env:
npx GSHEETS_API_KEY=xyz gsheets --key=SPREADSHEETID --title=foobar --pretty
if you are using dotenv in your project, you can specify GSHEETS_API_KEY as a var in your .env file and run:
NODE_OPTIONS='-r dotenv/config' gsheets --key=SPREADSHEETID--title=foobar --pretty
.map
, .filter
etc.null
{data: []}
There are a few libraries around which allow you to access Google Spreadsheets, most notably Tabletop. However, they all have one or several drawbacks:
"123'456.79"
instead of 123456.789
)var gsheets = require('gsheets');
Returns the contents of a worksheet, specified by its title.
For empty worksheets data
is []
.
gsheets.getWorksheet('SPREADSHEET_KEY', 'WORKSHEET_TITLE', 'GSHEETS_API_KEY')
.then(res => console.log(res));
Example Response:
{
"data": [
{
"foo": "bar",
"baz": 42,
"boing": null
},
// more rows ...
]
}
Replace "YOUR_GSHEETS_API_KEY" in index.tests.js with your key, then run the tests with:
npm run test:watch
Have a look at the test spreadsheet
Publish a new version with
npm run shipit
Jeremy Stucki, Interactive Things
BSD, see LICENSE
FAQs
Get public Google Spreadsheets as plain JavaScript/JSON
The npm package gsheets receives a total of 147 weekly downloads. As such, gsheets popularity was classified as not popular.
We found that gsheets demonstrated a not healthy version release cadence and project activity because the last version was released 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
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.