Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
A simple node & browser graph database
npm install --save giraffe
import Giraffe from 'giraffe';
const db = new Giraffe();
export default db;
new Giraffe(data)
data
: Object
Optional
{ nodes: [], edges: [] }
Nodes
and Edges
are checked for their correct shape..create(label, data)
label
: String
Optionaldata
: Object
.remove(nodes)
nodes
: Array
Array of Nodes to be removed from graph
.edge([ from ], [ to ], label, properties)
from
Array
Array of Nodes where edge originatesto
: Array
Array of Nodes where edge goeslabel
: String
Optionalproperties
: Object
Optional.query(label, properties)
label
: String
Optionalproperties
: Object
Optional
_edges
.update([ nodes ], [ labels ], data)
nodes
: Array
(or single) node to be updatedlabels
: Array
(or single) label to be added to Nodes.data
: Object
Data set to be merged with previous data, any duplicate keys will be overwritten.{
/**
* All relationships with additional properties
*/
edges: [],
/**
* All nodes with properties
*/
nodes: [],
/**
* Dynamic key:value store for tracking known node and edge labels
*/
labels: {
nodes: {
[label]: [/* Array of Node ids */]
},
edges: {
[label]: [/* Array of Edge ids */]
}
}
}
{
identity: Number,
properties: Object,
labels: Array,
edges: Array,
}
properties
is the object passed into the db.create
method.edges
is an array of Edge identity's before a query, after a query it is an array of references to the Node
's they represent{
identity: Number,
from: <Node Identity /> || <Node />,
through: <Node Identity /> || <Node />,
label: String,
properties: Object
}
properties
is the object passed into the db.edge
method.from
and through
are stored in the DB as from.identity
and through.identity
.db.query
returns from
and through
are references to the Node
's they representnew Giraffe(() => {})
)FAQs
Lightweight Graph DB implementation
The npm package giraffe receives a total of 16 weekly downloads. As such, giraffe popularity was classified as not popular.
We found that giraffe 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
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.