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

@grafio/browser

v7.15.2

Published

Browser-optimized bundle of Grafio graph database with Cypher support

Downloads

28

Readme

@grafio/browser

Browser-optimized bundle of Grafio — a high-performance graph database with native Cypher support.

This package bundles the entire Grafio core (Graph engine, Cypher query language, InMemoryStorageProvider) into self-contained JavaScript files that run directly in the browser. No Node.js required.

This is the browser distribution of grafio. For the full Node.js package with all features (caching, MongoDB storage, etc.), use grafio.

Features

  • Cypher Queries — Full OpenCypher-compatible query language (MATCH, CREATE, DELETE, MERGE, WHERE, ORDER BY, aggregations, variable-length paths)
  • Execution Plans — Inspect query plans in text, JSON, or Mermaid format
  • Zero Dependencies — Entire library bundled into a single file, no runtime dependencies
  • Lightweight — ~156KB minified, ~45KB gzipped
  • ESM + UMD — Works with <script> tags, <script type="module">, and modern bundlers

Installation

npm

npm install @grafio/browser

CDN

<!-- unpkg -->
<script src="https://unpkg.com/@grafio/browser/dist/grafio.browser.min.js"></script>

<!-- jsdelivr -->
<script src="https://cdn.jsdelivr.net/npm/@grafio/browser/dist/grafio.browser.min.js"></script>

Usage

Script Tag (UMD)

<script src="https://unpkg.com/@grafio/browser/dist/grafio.browser.min.js"></script>
<script>
  const { Graph, CypherEngine } = Grafio;

  const graph = new Graph();
  const engine = new CypherEngine(graph);

  // Create data
  await engine.execute("CREATE (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'})");
  await engine.execute("MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'}) CREATE (a)-[:KNOWS]->(b)");

  // Query
  const result = await engine.execute("MATCH (p:Person)-[:KNOWS]->(friend) RETURN p.name, friend.name");
  console.log(result.rows);
</script>

ES Module

<script type="module">
  import { Graph, CypherEngine } from 'https://unpkg.com/@grafio/browser/dist/grafio.browser.mjs';

  const graph = new Graph();
  const engine = new CypherEngine(graph);

  await engine.execute("CREATE (n:Person {name: 'Alice'})");
  const result = await engine.execute("MATCH (p:Person) RETURN p");
  console.log(result.rows);
</script>

npm + Bundler

import { Graph, CypherEngine } from '@grafio/browser';

const graph = new Graph();
const engine = new CypherEngine(graph);

await engine.execute("CREATE (n:Person {name: 'Alice'})");
const result = await engine.execute("MATCH (p:Person) RETURN p");

Query Examples

const engine = new CypherEngine(graph);

// Parameterized queries
await engine.execute("CREATE (n:Person {name: $name, age: $age})", { name: 'Alice', age: 30 });

// MATCH with WHERE
const result = await engine.execute("MATCH (p:Person) WHERE p.age > $minAge RETURN p", { minAge: 25 });

// Aggregations
const stats = await engine.execute("MATCH (p:Person) RETURN COUNT(p) AS total, AVG(p.age) AS avgAge");

// Variable-length paths
const paths = await engine.execute("MATCH path = (a)-[:KNOWS*1..3]->(b) RETURN path");

// Execution plan inspection
const plan = await engine.getQueryPlan("MATCH (p:Person) WHERE p.name = $name RETURN p", { name: 'Alice' }, 'text');
console.log(plan);

Exported API

| Export | Description | |--------|-------------| | Graph | Graph database instance | | CypherEngine | Cypher query executor | | InMemoryStorageProvider | In-memory storage backend | | GraphToMermaid | Convert graph to Mermaid diagram | | PlanFormatter | Format execution plans | | Node, Edge | Graph entity classes | | Error classes | CypherSyntaxError, CypherSemanticError, CypherRuntimeError, etc. |

Browser Support

Requires crypto.randomUUID() support (all modern browsers):

  • Chrome 92+
  • Firefox 95+
  • Safari 15.4+
  • Edge 92+

Relationship to Grafio

| | grafio | @grafio/browser | |---|---|---| | Environment | Node.js | Browser | | Storage | In-memory, MongoDB, Redis cache | In-memory only | | Caching | LRU/LFU/FIFO with Redis support | Not included | | Cypher Engine | ✅ Full | ✅ Full | | Graph Core | ✅ Full | ✅ Full | | Package Size | ~500KB (with all deps) | ~156KB minified |

The Cypher engine and graph core are identical between both packages. The browser bundle excludes server-only features (Redis cache, MongoDB storage, GraphManager) and packages everything into a single self-contained file.

License

GPL-3.0 — same as grafio.

Links