Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Cosm is the new name for Pachube.
"Connect devices and apps on the Cosm platform, exchange data and ideas with developers, and bring smart products to the world."
$ npm install cosm
var cosm = require('cosm');
client = new cosm.Cosm('insert API key here'),
feed = new cosm.Feed(cosm, {id: 12345}),
stream = new cosm.Datastream(client, feed, {id: 1})
stream.addPoint(1.234); // Adds a data point with the timestamp now
// Creates a datapoint at a specific timestamp
stream.addPoint(2.345, new Date(2012, 11, 11, 11, 11);
// Creates a datapoint now, with a callback - this API will likely change to
// be a bit nicer to use.
stream.addPoint(3.456, undefined, function () {
console.log("Point added...");
});
You can also create feeds, list existing feeds, add streams to a feed, and list streams associated with a feed:
client.create({ }, function(err, id) {
if (err) return ...;
feed2 = new cosm.Feed(cosm, { id: id });
feed2.get(function(err, data) {
if (err) return ...;
// data is a json representation of the stream, including datastream metadata (if any)
data.datastreams = data.datastreams || [];
});
feed2.addStream({ id: 2 }, function(err, body) {
if (err) return ...;
// body is presently null
});
});
client.list({ /* query parameters, if any */ }, function(error, json) {
if (err) return ...;
// json is the metadata for the stream
});
You can queue data to be uploaded, by setting the queue_size for the Datastream, the API will only push data to Cosm when the queue is full.
var stream = new cosm.Datastream(client, feed, {id: 1, queue_size: 20});
The queue_size defaults to 1, so data is pushed as it's added.
(The MIT License)
Copyright (c) 2012 Kevin McDermott.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
A library for interfacing with Cosm http://cosm.com/
The npm package cosm receives a total of 1 weekly downloads. As such, cosm popularity was classified as not popular.
We found that cosm 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.