
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@pforth/dbfuncs
Advanced tools
This module lets you get async mysql database pool connections. Also has lots of cool helper query funcs.
This project should be published in a locally running npm repo. You can do the following:
npm install -g verdaccio
nohup verdaccio --listen 4873
npm set registry http://localhost:4873/
You can also refer to here
const db=require("dbfuncs");
db.createPoolsFromFile(); // defaults to config.json
OR
db.createPoolsFromFile("config.json", {local: {password:"fred"}}); // Provide a default password of fred for the db "local"
OR
let pool=db.createPool(conName, host, user, password, database)
// If you create a pool called "local" then you can use
let conn=db.getConnLocal();
OR
let conn=db.getConn("local");
OR
let conn=db.getConn(localPool); // If you already got the local pool object from somewhere.
OR
let conn=db.getConn(); // To get the default pool (first one created or explicitly set)
await conn.query("DELETE FROM atable"); // Any query. Returns a list of rows (dictionaries) if a select
await conn.getRow("SELECT field, field2 FROM hi WHERE id=1"); // Returns a single (or first) row as a dictionary
await conn.get("SELECT field FROM hi WHERE id=1;"); // Get the first field in the first row returned (synonym for getFirstField())
await conn.getField("one", "SELECT one, two FROM three"); // Returns a single field from the first row
await conn.getDictForField("id", "field", "SELECT id, field FROM hi"); // Returns a dictionary of key -> value
await conn.getDict("id", "SELECT id, field, another FROM hi"); // Returns a dictionary of keys -> each row of results.
await conn.getList("name", "SELECT name FROM users"); // Returns a list by taking the value of a single field from each row
await conn.getDictOfLists("nonuniqueId", "saleId", "SELECT userId, saleId FROM sales")
// Returns a dictionary of lists (in this case a list of all the sales for each user)
// If the second arg = null then each list item contains the entire row for that key
await conn.insert("users SET name=?", ["fred"]); // Does a sql insert
db.setDefPool(name); // Explicitly set the default pool to a pool with a different name
FAQs
Useful async Database functions
We found that @pforth/dbfuncs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.