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

@cedarville/cedarlogic-engine

v2.4.0

Published

CedarLogic digital circuit simulation engine compiled to WebAssembly

Readme

@cedarville/cedarlogic-engine

CedarLogic's digital circuit simulation engine compiled to WebAssembly. Run logic simulations in the browser or Node.js — ~385KB total.

Install

npm install @cedarville/cedarlogic-engine

Quick Start

import CedarLogic from "@cedarville/cedarlogic-engine";

const engine = await CedarLogic();
const circuit = new engine.Circuit();

// Create an AND gate with 2 inputs
const and = circuit.newGateAuto("AND");
circuit.setGateParameter(and, "INPUT_BITS", "2");

// Drive both inputs HIGH
const drv0 = circuit.newGateAuto("DRIVER");
circuit.setGateParameter(drv0, "OUTPUT_BITS", "1");
circuit.setGateParameter(drv0, "OUTPUT_NUM", "1");

const drv1 = circuit.newGateAuto("DRIVER");
circuit.setGateParameter(drv1, "OUTPUT_BITS", "1");
circuit.setGateParameter(drv1, "OUTPUT_NUM", "1");

// Wire it up
const w0 = circuit.newWireAuto();
const w1 = circuit.newWireAuto();
const wOut = circuit.newWireAuto();

circuit.connectGateOutput(drv0, "OUT_0", w0);
circuit.connectGateOutput(drv1, "OUT_0", w1);
circuit.connectGateInput(and, "IN_0", w0);
circuit.connectGateInput(and, "IN_1", w1);
circuit.connectGateOutput(and, "OUT", wOut);

// Simulate
circuit.stepN(5);
console.log(circuit.getWireState(wOut)); // 1 (ONE)

circuit.delete(); // free C++ memory

Wire States

| Constant | Value | Description | |----------|-------|-------------| | ZERO | 0 | Logic low | | ONE | 1 | Logic high | | HI_Z | 2 | High impedance | | CONFLICT | 3 | Driver conflict | | UNKNOWN | 4 | Uninitialized |

Gate Types

Combinational: AND, OR, XOR, EQUIVALENCE (XNOR), BUFFER

Input/Output: DRIVER, CLOCK, PULSE

Mux/Decoder: MUX, DECODER, PRI_ENCODER

Arithmetic: ADDER, COMPARE

Sequential: JKFF, REGISTER

Memory: RAM

Connectivity: FROM, TO, TGATE, NODE, BUS_END

API

// Creation
circuit.newGateAuto(type: GateType): number
circuit.newWireAuto(): number
circuit.deleteGate(id: number): void
circuit.deleteWire(id: number): void

// Connections
circuit.connectGateInput(gateID, inputName, wireID): number
circuit.connectGateOutput(gateID, outputName, wireID): number
circuit.disconnectGateInput(gateID, inputName): void
circuit.disconnectGateOutput(gateID, outputName): void

// Parameters
circuit.setGateParameter(gateID, name, value): void
circuit.getGateParameter(gateID, name): string

// Simulation
circuit.step(): StepResult        // { changedWires: [{id, state}], time }
circuit.stepN(n): StepResult      // batch step
circuit.getWireState(wireID): WireState
circuit.getSystemTime(): number
circuit.delete(): void            // must call when done

Full API docs and pin reference: Wiki

License

MIT