Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
node-tsguru
Advanced tools
TimeSeries.Guru Node.js client.
npm install node-tsguru
Demo applications are available at:
var tsguru = require("node-tsguru");
tsguru({token: "abc123456789def", databaseID: "abc123456789def"}, function(err, client) {
if (err) throw err;
console.log("connected");
// interact with client like demonstrated below
});
client.insert("sensor01", 123.45, function(err) {
if (err) throw err;
console.log("inserted");
});
client.insert("sensor01", 123.45, 100, function(err) {
if (err) throw err;
console.log("inserted");
});
client.insertSymbol("sensor", "sen01", 123.45, function(err) {
if (err) throw err;
console.log("inserted");
});
client.insertSymbol("sensor", "sen01", 123.45, 10, true, function(err) {
if (err) throw err;
console.log("inserted");
});
client.bulk()
.add("sensor01", 123.45)
.add("sensor02", 234.56)
.add("sensor03", 345.67)
.add("sensor04", 456.78)
.insert(function(err) {
if (err) throw err;
console.log("bulk inserted");
});
var buffer = client.buffer({delay: 250});
buffer.on("error", function(err) {
throw err;
});
buffer.on("flushed", function() {
console.log("flushed");
});
setInterval(function() {
buffer.add("sensor01", 123.45);
}, 100);
buffer()
returns an [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter)
. Emitted events are error
, flush
and flushed
.
var tsguru = require("node-tsguru");
tsguru({token: "abc123456789def", databaseID: "abc123456789def"})
.then(function(client) {
console.log("connected");
// interact with client like demonstrated below
})
.catch(function(err) {
console.log(err);
});
client.insert("sensor01", 123.45)
.then(function(client) {
console.log("inserted");
})
.catch(function(err) {
console.log(err);
});
client.bulk()
.add("sensor01", 123.45)
.add("sensor02", 234.56)
.add("sensor03", 345.67)
.add("sensor04", 456.78)
.insert()
.then(function(client) {
console.log("bulk inserted");
})
.catch(function(err) {
console.log(err);
});
params
: Object
token
: StringdatabaseID
: Stringtimeout
: Number in milliseconds (optional, default: 10000)cb
: Function(err, client) (optional)
err
: Error or undefinedclient
: Client or undefinedreturns a Promise if no cb
was supplied
Client
is an [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter)
.
Insert into a simple time series.
timeseriesName
: Stringvalue1
... valueN
: Number, Boolean or Stringcb
: Function(err) (optional)
err
: Error or undefinedreturns a Promise if no cb
was supplied
Insert into a symbol time series.
timeseriesName
: Stringsymbol
: Stringvalue1
... valueN
: Number, Boolean or Stringcb
: Function(err) (optional)
err
: Error or undefinedreturns a Promise if no cb
was supplied
returns a Bulk
Add to a simple time series.
timeseriesName
: Stringvalue1
... valueN
: Number, Boolean or StringAdd to a symbol time series.
timeseriesName
: Stringsymbol
: Stringvalue1
... valueN
: Number, Boolean or StringInsert takes care about maximal allowed body size. A single insert can be split into multiple POST calls if the HTTP body gets to large.
cb
: Function(err) (optional)
err
: Error or undefinedreturns a Promise if no cb
was supplied
params
: Object
delay
: Number - delay in millisecondsreturns a Buffer
Add to a simple time series.
timeseriesName
: Stringvalue1
... valueN
: Number, Boolean or StringAdd to a symbol time series.
timeseriesName
: Stringsymbol
: Stringvalue1
... valueN
: Number, Boolean or StringFlush the buffer and stop the interval timer. No more adds after close!
cb
: Function(err) (optional)
err
: Error or undefinedreturns a Promise if no cb
was supplied
FAQs
TimeSeries.Guru Node.js client
We found that node-tsguru 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.