
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.
@hydre/rgraph
Advanced tools
Redisgraph
>2.10
4.3.0)Rgraph use tagged templates in order to seamlessly serialize any inputs while keeping a nice flow which looks like simple interpolation.
npm i @hydre/rgraph
Node >16
node index.js

import Rgraph from '@hydre/rgraph'
import Redis from 'ioredis'
import Events from 'events'
const client = new Redis()
const Graph = Rgraph(client)
const foo = Graph('foo')
const user = { uuid: 'xxxx-xxxx-xxxx', name: 'Tony' }
await Events.once(client, 'ready')
await foo.run`MERGE (tony:User ${ user }) RETURN tony`
await foo.delete()
allow debug logs with the DEBUG='rgraph*' env variable
Get yourself some tea and meat by providing your redis client
import Rgraph from '@hydre/rgraph'
import Redis from 'ioredis'
const redis_client = new Redis()
const use_graph = Rgraph(redis_client)
Wow now you can get as much graphs as you want 💃 ! go ahead don't be afraid it's redis, not neo4j 🦐
const my_first_graph = use_graph('myFirstGraph')
const foo = use_graph('anotherGraph')
const thanos = use_graph('hail-hydra')
const bar = use_graph('barGraph')
Run any Cypher query with a tag template or delete your poor graph
await foo.run`MATCH (n) RETURN n`
await thanos.delete()
Let me show you the result structure for each type, with the visible properties you also have access to some internals infos like ids and labels etc..
import { Internals } from '@hydre/rgraph'
[
// each object is a sequence of the results
{
// For a scalar
['label in the RETURN statement']: 'value', // the returned value
// For a node
['label in the RETURN statement']: {
['each']: ...,
['node']: ...,
['properties']: ...,
[Internals.ID]: 0, // the node internal id
[Internals.NODE_LABELS]: [], // the node labels
},
// For an edge
['label in the RETURN statement']: {
['each']: ...,
['node']: ...,
['properties']: ...,
[Internals.ID]: 0, // the edge internal id
[Internals.EDGE_LABEL]: 'label', // the edge label
[Internals.SOURCE_NODE_ID]: 0, // the source node id
[Internals.DESTINATION_NODE_ID]: 0 // the destination id
},
// For a path
['label in the RETURN statement']: {
nodes: [], // an array of nodes (same representation as above but without the return label)
edges: [] // an array of edges
}
}
]
The library provide some additional operators
import { raw } from '@hydre/rgraph/operators'
const maybe = false ? 'AND 1 = 2' : ''
const conditionnal = `WHERE 1 = 1 ${ raw(maybe) }`
Welcome to the era of fast graphs..
await myFirstGraph.run/* cypher */`
MERGE (foo:User ${ user })-[:Knows]->(thanos { name: 'Thanos', age: ${5 + 5}, a: ${true}, c: ${51.000000000016} })
WITH foo, thanos
MATCH path = ()-[]-()
RETURN path`

new in 4.2.0
When writting long queries you might want to help your team to understand it
by adding comments. Every trimmed new line starting with // will be ignored
await graph.run/* cypher */`
MATCH (u:User)
WHERE (
u.name = 'pepeg' AND
u.age > 30
)
// hey i'm a comment
RETURN u AS goog_pepeg
`
Can i use nested objects ?
No, a Graph database use Nodes, not documents. A node is a hash of key value pairs and edges (relations) to other nodes
Commonjs support
I don't plan to support commonjs as i don't plan to ask tesla to use fuel. If you're still using commonjs, it will be better if you shutdown your computer right now
Edit me
FAQs
A high performance Node.js RedisGraph client.
The npm package @hydre/rgraph receives a total of 13 weekly downloads. As such, @hydre/rgraph popularity was classified as not popular.
We found that @hydre/rgraph demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.