@jim-fx/nodez
v1.0.8
Published
Package to do blender type node stuff in the browser.
Downloads
1
Readme
Extensible Node System à la Blender
Table of Contents
About The Project
This project came out of another project where i needed a node interface.
Getting Started
Installation
NPM:
yarn add @jim-fx/nodez
CDN:
<script src="https://unpkg.com/@jim-fx/nodez/dist/index.umd.js"></script>
Usage
Import it as module:
import { NodeSystem } from '@jim-fx/nodez';
Then use it like so:
const system = new NodeSystem();
If you want to register your own node types:
system.registerNodeType({
name: 'subtract',
inputs: ['number', 'number'],
outputs: ['number'],
// I strongly recommend to destructure and use defaults
compute([input1 = 0, input2 = 0], state) {
return input1 - input2;
},
});
Saving and loading of systems
// save the node system
const save = system.deserialize();
// Download/Upload/stringify the save
// Load the node system
system.serialize(save);