Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
express-database
Advanced tools
Readme
const mysql = require('express-database-mysql')
const app = express()
// define here routes without needed database connection
// ex: static routes, index page, etw.
// use the database middleware
app.use(database({
db: mysql("mysql://foo:bar@example.com/db")
})
app.get("/api/foobar", function(req, res, next) {
const { query, set, get, connect } = req.database
query('show databases').then([rows] => rows) // our abstract api
connect.do.some() // yours unsafe raw connector
// ...
// the database connection will be closed automatically
res.render('page')
})
req.database
- reference to connection to your database.req.database.connect
- reference to raw connection to your databasereq.database.close
- close connection to database, called automatically.options.db
- connection's constructor; it should have method open
that return Promise
with connection.Each connector should have connect
property and method close()
. Is's required api. Connectors can have any count of other helper methods. Each method should return Promise
. Property connect
should hold reference to raw api. See express-database-mysql
as example.
MIT, 2016 (c) Dmitry Tsvettsikh
FAQs
Simple database middleware for Express
The npm package express-database receives a total of 2 weekly downloads. As such, express-database popularity was classified as not popular.
We found that express-database 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.