
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
google-spreadsheet-report
Advanced tools
A simple library to append data to a google spreadsheet.
npm install google-spreadsheet-report
The appendData
function appends data to the bottom of a google spreadsheet. Like a log. To keep the document from getting too big, rows with dates older than the retention limit will be purged on each update.
const dayjs = require('dayjs')
const gsr = require('../google-spreadsheet-report')
const options = {
email: 'test-579@rock-arc-1124354.iam.gserviceaccount.com',
key: `-----BEGIN PRIVATE KEY-----
Private key here
-----END PRIVATE KEY-----`,
spreadsheetId: '<spreadsheetId>',
sheet: '<name of sheet>', // Optional. Defaults to the first sheet.
retention: 14, // Retention in days. Defaults to 14.
}
const data = {
date: dayjs().format('YYYY-MM-DD'),
val1: Math.floor(Math.random() * 50),
val2: Math.floor(Math.random() * 1000),
}
const run = async () => {
try {
await gsr.appendData(data, options)
} catch (e) {
console.error(e)
}
}
run()
This would produce a spreadsheet looking something like this:
date | val1 | val2 |
---|---|---|
2019-06-02 | 34 | 759 |
If you later add an extra attribute like this
const data = {
date: dayjs().format('YYYY-MM-DD'),
val1: Math.floor(Math.random() * 50),
val2: Math.floor(Math.random() * 1000),
val3: Math.floor(Math.random() * 1000),
}
await gsr.appendData(data, options)
a new column would be added to the spreadsheet:
date | val1 | val2 | val3 |
---|---|---|---|
2019-06-02 | 34 | 759 | |
2019-06-03 | 12 | 846 | 594 |
The worksheet is created if it doesn't exist. Any missing column headers are also added.
The setKeyValues
finds the row with a matching key and updates all the values on that row. The row is created if it doesn´t exist
const dayjs = require('dayjs')
const gsr = require('../google-spreadsheet-report')
const options = {
email: 'test-579@rock-arc-1124354.iam.gserviceaccount.com',
key: `-----BEGIN PRIVATE KEY-----
Private key here
-----END PRIVATE KEY-----`,
spreadsheetId: '<spreadsheetId>',
sheet: '<name of sheet>', // Optional. Defaults to the first sheet.
keyName: 'job', // Name of the column to update. Defaults to "name".
}
const data = {
job: 'Nightly report',
'last run': dayjs().format('YYYY-MM-DD HH:mm'),
status: 'OK',
error: ''
}
const run = async () => {
try {
await gsr.setKeyValues(data, options)
} catch (e) {
console.error(e)
}
}
run()
This would output the following data.
job | last run | status | error |
---|---|---|---|
Nightly report | 2019-12-22 21:44 | OK |
If you run the same code again, only the value of last run
on that same line would be updated.
openssl pkcs12 -in <filename.p12> -nodes -nocerts > key.pem
notasecret
https://docs.google.com/spreadsheets/d/1IeEaLOGLuIcy5oPN-OZlxzYwPYRuzVnlrpDlqkzWtOk/edit#gid=0
1IeEaLOGLuIcy5oPN-OZlxzYwPYRuzVnlrpDlqkzWtOk
const options = {
email: 'test-579@rock-arc-1124354.iam.gserviceaccount.com',
key: `-----BEGIN PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDDVa....
-----END PRIVATE KEY-----`,
spreadsheetId: '1IeEaLOGLuIcy5oPN-OZlxzYwPYRuzVnlrpDlqkzWtOk',
}
FAQs
A simple way to create a report in google spreadsheet
The npm package google-spreadsheet-report receives a total of 19 weekly downloads. As such, google-spreadsheet-report popularity was classified as not popular.
We found that google-spreadsheet-report 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.