
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@carbon-io/leafnode
Advanced tools
leafnode is a "synchronous" MongoDB driver. It is a wrapper around node-mongodb-native implemented using the node-fibers co-routine library.
leafnode is currently experimental and in alpha.
Example:
var connect = require('@carbon-io/leafnode').connect;
try {
var db = connect("mongodb://localhost:27017/mydb");
var c = db.getCollection("users");
var results = c.find({"firstName" : "Joe"}).toArray();
console.log(results);
} catch e {
console.log(e);
}
No callbacks needed. If an error occurs an exception is thrown.
We say "synchronous" because leafnode code execution is still asynchronous under the hood, but uses Fibers to provide a synchronous programming interface. One should therefore note that many functions and methods of this driver actually yield control to the event loop during execution. For more on Fibers see the documenentation here.
Using npm
% cd <your-app>
% npm install leafnode
From git
% git clone git@github.com:objectlabs/leafnode.git
% cd <your-app>
% npm install <path-to-leafnode>
% node ./test/all.js
leafnode in your codeIn order to use leafnode you need to properly bootstrap your application by creating a Fiber for the code to run in.
The basic idea is as follows:
require('fibers');
Fiber(function() {
//do stuff
}).run();
In practice you will want to do this at the beginning of a command line program or, if using an application toolkit like express, as you process each request. One nice way of achieving this in express is to add a middleware function that wraps request handling in a Fiber.
app.use(function(req, res, next) {
Fiber(function() {
next();
}).run();
});
FAQs
Sync driver for MongoDB
We found that @carbon-io/leafnode demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.