Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
decypher is a node.js library packing a handful of utilities to deal with cypher queries.
It includes the following:
You can install decypher from npm likewise:
npm install decypher
or from github if you need the latest development version:
npm install git+https://github.com/Yomguithereal/decypher.git
Write one or more cypher queries per file:
File containing a single query
// Any comments...
MATCH (n)-[r]-(t)
RETURN n,r,t LIMIT 100;
File containing multiple named queries
// name: first
// Retrieve book nodes
MATCH (b:Book)
RETURN b;
// name: second
// Retrieve vocabulary nodes
MATCH (v:Vocabulary)
RETURN v;
Just require decypher and use it to load your queries:
var decypher = require('decypher');
// Loading a single query
decypher('./single-query.cypher');
>>> 'MATCH (n)-[r]-(t)\nRETURN n,r,t LIMIT 100;'
// Loading multiple named queries
decypher('./multiple-queries.cypher');
>>> {
first: 'MATCH (b:Book)\nRETURN b;',
second: 'MATCH (v:Vocabulary)\nRETURN v;'
}
// Loading a batch of files at once
decypher({
single: './single-query.cypher',
multiple: './multiple-queries.cypher'
});
>>> {
single: 'MATCH (n)-[r]-(t)\nRETURN n,r,t LIMIT 100;',
multiple: {
first: 'MATCH (b:Book)\nRETURN b;',
second: 'MATCH (v:Vocabulary)\nRETURN v;'
}
}
// Loading the content of a folder
// folder/
// - single.cypher
// - multiple.cypher
decypher('./folder');
>>> {
single: 'MATCH (n)-[r]-(t)\nRETURN n,r,t LIMIT 100;',
multiple: {
first: 'MATCH (b:Book)\nRETURN b;',
second: 'MATCH (v:Vocabulary)\nRETURN v;'
}
}
// Choosing a different extension when loading a folder
decypher('./path-to-queries-folder', 'cql');
Note that this query builder is widely inspired by the query-builder package by @shesek but fixed and updated to support cypher's latest evolutions.
var cypher = require('decypher').builder;
// Creating a query
var query = cypher()
.match('MATCH (n:Node)')
.where('n.title = {title}', {title: 'The best title'})
.return('n');
// Compiling to string
query.compile();
// or
query.toString();
// MATCH (n:Node)
// WHERE n.title = {title}
// RETURN n;'
// Retrieving the query's parameters
query.params();
>>> {
title: 'The best title'
}
// Note that multi words statements like `ORDER BY`
// have to be written in camel-case:
query.orderBy('n.title');
// You can also set a bunch of params at once
query.params({whatever: 'is needed'});
// Finally, you can add arbitrary parts to the query if required
query.add('anything you want');
query.add('with {param}', {param: 'heart'});
Contributions are of course more than welcome. Be sure to add and pass any relevant unit tests before submitting any code.
git clone git@github.com:Yomguithereal/decypher.git
cd decypher
# Installing dependencies
npm install
# Running unit tests
npm test
FAQs
A handful of cypher utilities for Node.js
The npm package decypher receives a total of 33 weekly downloads. As such, decypher popularity was classified as not popular.
We found that decypher 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
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.