npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dortdb/lang-cypher

v2.1.0

Published

Cypher parser and executor for DortDB

Downloads

60

Readme

@dortdb/lang-cypher

A Cypher-based query language plug-in for DortDB. It adds data-selection queries for property graphs: data best expressed as nodes connected by relationships, with visual ASCII-art pattern matching and variable-length paths.

The language is a set of implementation extensions to Cypher, based on the openCypher grammar (see License and attribution below).

Installation

npm install @dortdb/core @dortdb/lang-cypher graphology

@dortdb/core and graphology are peer dependencies; graphology backs the default data adapter.

Usage

import { DortDB } from '@dortdb/core';
import { defaultRules } from '@dortdb/core/optimizer';
import { Cypher, gaLabelsOrType } from '@dortdb/lang-cypher';
import { MultiDirectedGraph } from 'graphology';

const db = new DortDB({
  mainLang: Cypher({ defaultGraph: 'social' }),
  optimizer: { rules: defaultRules },
});

const graph = new MultiDirectedGraph();
graph.addNode('alice', { [gaLabelsOrType]: ['Person'], name: 'Alice', age: 30 });
graph.addNode('bob', { [gaLabelsOrType]: ['Person'], name: 'Bob', age: 20 });
graph.addEdge('alice', 'bob', { [gaLabelsOrType]: 'KNOWS' });

db.registerSource(['social'], graph);

db.query('MATCH (p:Person) RETURN p.name AS name ORDER BY name');

Data adapter

The default adapter queries Graphology graphs. It expects node labels and edge types under the gaLabelsOrType symbol-keyed attribute ({ [gaLabelsOrType]: ['Person'] } for a node, { [gaLabelsOrType]: 'KNOWS' } for a relationship). A plain labels property is not recognized, so label and type patterns like (:Person) would silently match nothing.

Set the graph to query with the defaultGraph option, or per query with a FROM clause:

FROM myOtherGraph
MATCH (n)
RETURN n

Dialect

The parser accepts the full openCypher 9 grammar, but, in keeping with DortDB's data-selection focus, only the read subset is executed. Data-writing clauses (CREATE, MERGE, SET, REMOVE, DELETE) are rejected during planning.

License and attribution

This package derives from the openCypher grammar, which is licensed under the Apache License, Version 2.0, and was created by the collective efforts of the openCypher community.

This work is not approved by the public consensus process of the openCypher Implementers Group. In keeping with the openCypher attribution terms, it is described as implementation extensions to Cypher, not as "Cypher" or "openCypher". Cypher® is a registered trademark of Neo4j, Inc.

See the NOTICE file for the full attribution, and src/parser/cypher.pegjs for the licensed grammar.

Documentation

See the Cypher overview and dialect reference, or the full docs at filipjezek.github.io/dortdb.