Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
A basic graph database
There are two types of nodes (by default):
You can register nodes into a database and associate two nodes together. To get the nodes back you can either get all nodes of a type or get all associated nodes of an node (optionally restricting it to a type).
DB
Node
Data
If the constructor has a property called names, methods will be generated to get and set properties. Example:
var util = require('util')
var ddb = require('ddb')
function Name() {
ddb.Data.apply(this, arguments)
}
Name.names = [ 'type', 'val' ]
util.inherits(Name, ddb.data)
var name = new Name('last', 'Doe')
name.type() == 'last'
name.val() == 'Doe'
ID
Don't use one of these with multiple databases - only the last one you register it with will work
Query
These let you seperate the definition of what to find from finding them.
var ddb = require('ddb')
var util = require('util')
// Create a database
var db = new ddb.DB
// Create a person class of identity
function Person() {
ddb.ID.call(this)
}
util.inherits(Person, ddb.ID)
// Create a name class of data
function Name() {
ddb.Data.apply(this, arguments)
}
util.inherits(Name, ddb.Data)
// Create a new person
var johnDoe = new Person
db.register(johnDoe) // and register him with in the db
console.log('John Doe:', johnDoe)
// Create the first name
var firstName = new Name('first', 'John')
db.register(firstName) // register it
db.assoc(johnDoe, firstName) // associate it with John Doe
// Create the last name
var lastName = new Name('last', 'Doe')
db.register(lastName) // register it
db.assoc(johnDoe, lastName) // associate it with John Doe
console.log('John Doe\'s names:', db.assocs(johnDoe, Name))
console.log('People with a last name of Doe:', db.assocs(new Name('last', 'Doe')))
FAQs
A basic graph database
We found that 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.