
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.
@cnlabs/mongodb-cloud-connector
Advanced tools
This is MongoDB connector in cloud or local environment(Cloud Foundry)
Library to work with MongoDB in local and cloud environment
yarn add @cnlabs/mongodb-cloud-connector
npm install --save @cnlabs/mongodb-cloud-connector
For example use with express web server
import { db } from '@cnlabs/mongodb-cloud-connector';
app.get("/foo", async (req, res) => {
const bars = await (await db()).collection('bar').find({}).toArray()
res.send( { bars } )
});
db('default', {poolSize: 1}).then(()=> {
app.listen(process.env.PORT)
});
function db(name?: string, options?: MongoClientOptions): Promise<MongoClient>;
Connects to database depending on environment
Currently supported 3 possible environments:
default
No special environment variables are set
GitLab CI
MONGODB_URL environment variables is set
Cloud Foundry compatible
VCAP_SERICES environment variables is set
@param name Name of database or Cloud Foundry bound service
@param options Database connection options default is:
{
poolSize: 10,
autoReconnect: true,
useNewUrlParser: true
}
@return MongoClient to communicate with mongo
Mongo client is cached by name. It means that you call db() first time to get client connected
any sequential calls will return the same instance unless clearCache is called
Giving so wi need options only in first call
We recommend to make fist call as soon as possible (for example: before express.listen() call to
follow fail fast concept) and pass options to that call. any next call you can specify only name
FAQs
This is MongoDB connector in cloud or local environment(Cloud Foundry)
We found that @cnlabs/mongodb-cloud-connector 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.