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

@kayvanshah1/neuromorph

v0.1.28

Published

A biomimetic neural tree visualization where biology meets circuitry.

Downloads

625

Readme

Neuromorph

npm version npm downloads Publish Package Deploy Pages License: MIT TypeScript

A biomimetic neural tree visualization where biology meets circuitry.

Neuromorph is a real-time generative system that simulates neural-style branching structures with interactive physics and bioluminescent signal propagation.

Features

  • Fractal, recursive tree generation
  • Signal pulse propagation through branches
  • Branch-targeted interactions (left/right click on branch)
  • Real-time configurable parameters
  • Lightweight (Canvas 2D, no heavy dependencies)
  • React + framework-agnostic core API

Install

npm install @kayvanshah1/neuromorph

Peer Dependencies

react ^18
react-dom ^18

Usage (React)

import { NeuromorphTree } from "@kayvanshah1/neuromorph";

export function Demo() {
	return (
		<div style={{ height: 600 }}>
			<NeuromorphTree
				config={{ maxDepth: 7, branchSpread: 60, glowStrength: 30 }}
				onNodeCount={(n) => console.log(`${n} nodes`)}
			/>
		</div>
	);
}

Usage (Core)

import { createNeuromorphTree } from "@kayvanshah1/neuromorph/core";

const container = document.getElementById("neuromorph")!;
const instance = createNeuromorphTree(container, { treeScale: 0.85 }, (count) =>
	console.log(count),
);

instance.updateConfig({ glowStrength: 40 });
instance.regenerate();
instance.destroy();

Usage (Vanilla HTML)

ESM (modern browsers)

<div id="neuromorph" style="height: 600px"></div>

<script type="module">
	import { createNeuromorphTree } from "https://cdn.jsdelivr.net/npm/@kayvanshah1/neuromorph/dist/core.js";

	const el = document.getElementById("neuromorph");
	createNeuromorphTree(el, { treeScale: 0.9 });
</script>

Script tag (no modules)

<div id="neuromorph" style="height: 600px"></div>

<script src="https://cdn.jsdelivr.net/npm/@kayvanshah1/neuromorph/dist/iife/neuromorph.min.js"></script>
<script>
	const el = document.getElementById("neuromorph");
	Neuromorph.createNeuromorphTree(el, { treeScale: 0.9 });
</script>

API Reference

NeuromorphTree (React)

type NeuromorphTreeProps = {
	config?: Partial<TreeConfig>;
	className?: string;
	onNodeCount?: (count: number) => void;
};

Notes:

  • Parent container must have an explicit size
  • config is merged with defaults
  • onNodeCount fires on each automatic pulse cycle (shineInterval)

createNeuromorphTree (Core)

function createNeuromorphTree(
	container: HTMLElement,
	config?: Partial<TreeConfig>,
	onNodeCount?: (count: number) => void,
): NeuromorphInstance;

type NeuromorphInstance = {
	controller: TreeController;
	destroy: () => void;
	updateConfig: (config: Partial<TreeConfig>) => void;
	regenerate: () => void;
};

Notes:

  • Call destroy() to clean up listeners and animation
  • updateConfig() applies changes without full rebuild
  • regenerate() creates a new tree with a fresh seed
  • Window resize keeps the existing tree and re-anchors it to bottom-center
  • Screenshot export keeps current render resolution and auto-crops excess space

Interactions

| Input | Action | | ---------------- | ------------------------------------ | | Left-click | Trigger sway when clicking a branch | | Right-click | Fire pulse when clicking a branch | | Double-click | Regenerate with a new random seed | | Press S | Save screenshot as PNG |

Configuration

TreeConfig

| Key | Default | Description | | ------------------- | ------- | ------------------------------ | | maxDepth | 6 | Recursion depth | | maxBranches | 3 | Max children per node | | branchSpread | 50 | Angular spread (degrees) | | treeScale | 0.92 | Overall size multiplier | | shineSpeed | 130 | Pulse speed (ms) | | swayIntensity | 0.065 | Sway amplitude | | swayDecay | 3000 | Sway damping (ms) | | growthDelay | 375 | Initial growth delay (ms) | | childDelay | 120 | Per-child delay (ms) | | growthDuration | 1800 | Branch animation duration (ms) | | leafGlowIntensity | 0.85 | Leaf brightness (0–1) | | leafDensity | 0.7 | Leaf probability | | branchThickness | 4 | Stroke width | | glowStrength | 25 | Glow intensity | | shineInterval | 3000 | Auto pulse interval (ms) | | hitTestRadius | 8 | Branch click detection radius (px) |

Build

pnpm --filter @kayvanshah1/neuromorph build

License

MIT