Skip to content

Setup Package Publishing #1

@seveibar

Description

@seveibar

Hey @danchitnis , wondering if you would publish a module that publishes the ngspice bindings as a standalone javascript/wasm module.

So somebody could do e.g.

npm add eecircuit

I'm not 100% sure on the API, but something like this?

import { SpiceSimulation } from "eecircuit"

const spiceSim = new SpiceSimulation()

spiceSim.setSpice(`
voltage divider netlist
V1 in 0 1
R1 in out 1k
R2 out 0 2k
.end
`)

await spiceSim.run()

I organized the API such that it could maybe stream responses eventually which i think ngspice is capable of.

I would love to help contribute this if it's interesting to you. My biggest concern (something I would need to report back on) is the loader. Runtimes like bun and deno can directly import WASM but IIRC it's not that simple with other runtimes.

If this isn't interesting and you'd like this repo to stay at the application level that's ok as well!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions