
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.
@dotconnor/ddb
Advanced tools
A DynamoDB Wrapper
To install first run this command in your project's main folder:
npm install @dotconnor/ddb --save
Then in your project include this at the top:
const ddb = require("@dotconnor/ddb");
Initializing ddb is very easy. If AWS Credentials are already on file then all you need to do is:
const db = new ddb();
For a profile other than default:
const db = new ddb({profile: "work"});
Or can you include your Access Key ID and Secret Access Key:
const db = new ddb({
accessKeyId: "...",
secretAccessKey: "...",
region: "us-west-2" //Defaults to us-east-1
});
ddb provides the scanBuilder class to help scan a table.
var scan = db.scan("TableName");
/*
scan = {
params: {
TableName: 'TableName',
FilterExpression: ''
},
_db: [Object]
}
*/
This returns a scanBuilder the the following methods:
addFilter(name, value, op)
scan = scan.addFilter("id", 123, "=");
/*
scan = {
params: {
TableName:"TableName",
FilterExpression:"id = :id",
ExpressionAttributeValues:{
":id":{
"N":"123"
}
}
},
_db: [Object]
}
*/
Calling the execute() method on the scanBuilder will return a Promise containing the items matching the given filters.
scan
.execute()
.then(function(data) {
console.log(data); //Array of items found. [] If none were found.
}).catch(function(err){
console.log(err):
});
ddb provides the updateBuilder class to help update an item.
var update = db.update("TableName");
Set the key name and its value of the item that need to be updated.
update.setKey("uuid", "a7d6as-528ad-1471");
Add the key and their values that need to be updated.
update.updateItem("email", "connor@dotconnor.com");
Increment an item:
update.incrementItem("karma", 1);
Update the selected item(s)
update.execute()
.then(function(data) {
console.log(data); // data should be = []
}).catch(function(err){
console.log(err):
});
putItem(TableName, Item)
db.putItem("Users", {
id: "1452a",
username: "dotconnor",
}).then(function(){
console.log("User Created");
});
generateId(TableName, ItemName, Type, opts)
db.generateId("Users", "uuid", "uuid")
.then(function(id){
console.log(id);
});
FAQs
A DynamoDB Wrapper
We found that @dotconnor/ddb 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
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.