{"_id":"@apostel/node-canvas-core","_rev":"4-683e690acb9bad28b80e729f0d1a8532","name":"@apostel/node-canvas-core","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@apostel/node-canvas-core","version":"1.0.0","keywords":[],"author":{"name":"Sam Apostel"},"license":"MIT","_id":"@apostel/node-canvas-core@1.0.0","maintainers":[{"name":"sam-apostel","email":"sam@apostel.be"}],"homepage":"https://github.com/Sam-Apostel/nodl#readme","bugs":{"url":"https://github.com/Sam-Apostel/nodl/issues"},"dist":{"shasum":"9822d1055fbf4f448f3bdb9aed0de7b3ce138d0e","tarball":"https://registry.npmjs.org/@apostel/node-canvas-core/-/node-canvas-core-1.0.0.tgz","fileCount":25,"integrity":"sha512-XBdFiSErzhnc8MNUx5I5QZ0xgccPYtX3fRlpAXaEAMlW1qD1wNr80wqo/5HbKNDPr4ba3RErHYxjFfwxTgnJIw==","signatures":[{"sig":"MEYCIQC/+/ILuy0tCaWfDOQaPSxUucD6O/V774V6TwNDYnNA+QIhAJZGRF97JfqHF33IuBkgXqcp8+/OPXlzb6W3tAF/2sAd","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18142},"main":"build/index.js","types":"./build/index.d.ts","gitHead":"2a5fb25f0619e9e3dce015fa32261e13fe574326","private":false,"scripts":{"test":"jest","build":"tsc","prepare":"yarn run build","generate:docs":"typedoc ./src/index.ts"},"_npmUser":{"name":"sam-apostel","email":"sam@apostel.be"},"repository":{"url":"git+https://github.com/Sam-Apostel/nodl.git","type":"git"},"_npmVersion":"10.5.0","description":"Core implementation of the @apostel/node-canvas framework","directories":{},"_nodeVersion":"22.12.0","dependencies":{"mobx":"^6.13.7","rxjs":"^7.8.2","uuid":"^11.1.0","typescript":"^5.8.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.3.1","typedoc":"^0.28.2","@types/jest":"^29.5.14","@types/uuid":"^10.0.0"},"peerDependencies":{"zod":"^3.24.2"},"_npmOperationalInternal":{"tmp":"tmp/node-canvas-core_1.0.0_1744115676246_0.7778373650667281","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@apostel/node-canvas-core","version":"1.1.0","keywords":[],"author":{"name":"Sam Apostel"},"license":"MIT","_id":"@apostel/node-canvas-core@1.1.0","maintainers":[{"name":"sam-apostel","email":"sam@apostel.be"}],"homepage":"https://github.com/Sam-Apostel/nodl#readme","bugs":{"url":"https://github.com/Sam-Apostel/nodl/issues"},"dist":{"shasum":"af224809d06e7b3c7d4e59a0f751566a8e471b24","tarball":"https://registry.npmjs.org/@apostel/node-canvas-core/-/node-canvas-core-1.1.0.tgz","fileCount":25,"integrity":"sha512-nZpqcwBzoG9CRqBBx2FY4n5zOlRYRWSa0FPD3WV6Eh2P0Ul8Cihen82Ml94YheVrA/Ex9dQ5SIrksn8iwWq6ig==","signatures":[{"sig":"MEQCIAHDEUzHVNvkx8y94fj1VcXL7tncCTzFfoSXt1Ao1drMAiB9q4lBcwzsy3Jdww6UEDBem6J8ngTDTSzNQl3c2EuAoA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18429},"main":"build/index.js","types":"./build/index.d.ts","gitHead":"1a03a28927cd39401731a232df77a5037d3c93d2","private":false,"scripts":{"test":"jest","build":"tsc","prepare":"yarn run build","generate:docs":"typedoc ./src/index.ts"},"_npmUser":{"name":"sam-apostel","email":"sam@apostel.be"},"repository":{"url":"git+https://github.com/Sam-Apostel/nodl.git","type":"git"},"_npmVersion":"10.5.0","description":"Core implementation of the @apostel/node-canvas framework","directories":{},"_nodeVersion":"22.12.0","dependencies":{"mobx":"^6.13.7","rxjs":"^7.8.2","uuid":"^11.1.0","typescript":"^5.8.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.3.1","typedoc":"^0.28.2","@types/jest":"^29.5.14","@types/uuid":"^10.0.0"},"peerDependencies":{"zod":"^3.24.2"},"_npmOperationalInternal":{"tmp":"tmp/node-canvas-core_1.1.0_1744732001225_0.030850868234683526","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@apostel/node-canvas-core","version":"1.1.1","keywords":[],"author":{"name":"Sam Apostel"},"license":"MIT","_id":"@apostel/node-canvas-core@1.1.1","maintainers":[{"name":"sam-apostel","email":"sam@apostel.be"}],"homepage":"https://github.com/Sam-Apostel/nodl#readme","bugs":{"url":"https://github.com/Sam-Apostel/nodl/issues"},"dist":{"shasum":"8507bdbac1499437a9bb5ea471b03f56b4557aa8","tarball":"https://registry.npmjs.org/@apostel/node-canvas-core/-/node-canvas-core-1.1.1.tgz","fileCount":25,"integrity":"sha512-IJzQA3NgaEkXS6D0ySKgaIcazL5fUy/tB32FkN3X9leEhp5Ki8ZSQj3zog4JUOfZJB5AmwROHMPpOEZwyGcdTw==","signatures":[{"sig":"MEQCIBCi9lEvxNnL/0hFI+0Gw/wYU/ZRTmBD+HOwCco1amCUAiArFsMa/89iYz4ILAC54s4jupo7jmI7aZF2GqMWT4C4Aw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18529},"main":"build/index.js","types":"./build/index.d.ts","gitHead":"cbe9f9a1ef47fa26ccd0517ccdfe962d978c3277","private":false,"scripts":{"test":"jest","build":"tsc","prepare":"yarn run build","generate:docs":"typedoc ./src/index.ts"},"_npmUser":{"name":"sam-apostel","email":"sam@apostel.be"},"repository":{"url":"git+https://github.com/Sam-Apostel/nodl.git","type":"git"},"_npmVersion":"10.5.0","description":"Core implementation of the @apostel/node-canvas framework","directories":{},"_nodeVersion":"22.12.0","dependencies":{"mobx":"^6.13.7","rxjs":"^7.8.2","uuid":"^11.1.0","typescript":"^5.8.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.3.1","typedoc":"^0.28.2","@types/jest":"^29.5.14","@types/uuid":"^10.0.0"},"peerDependencies":{"zod":"^3.24.2"},"_npmOperationalInternal":{"tmp":"tmp/node-canvas-core_1.1.1_1744812918226_0.0796959650700686","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@apostel/node-canvas-core","version":"1.2.0","description":"Core implementation of the @apostel/node-canvas framework","main":"build/index.js","author":{"name":"Sam Apostel"},"license":"MIT","private":false,"scripts":{"build":"tsc","prepare":"yarn run build","test":"jest","generate:docs":"typedoc ./src/index.ts"},"repository":{"type":"git","url":"git+https://github.com/Sam-Apostel/nodl.git"},"keywords":[],"bugs":{"url":"https://github.com/Sam-Apostel/nodl/issues"},"homepage":"https://github.com/Sam-Apostel/nodl#readme","dependencies":{"mobx":"^6.13.7","rxjs":"^7.8.2","typescript":"^5.8.3","uuid":"^11.1.0"},"devDependencies":{"@types/jest":"^29.5.14","@types/uuid":"^10.0.0","jest":"^29.7.0","ts-jest":"^29.3.1","typedoc":"^0.28.2"},"peerDependencies":{"zod":"^3.24.2"},"_id":"@apostel/node-canvas-core@1.2.0","gitHead":"7a97bf7387a7742be7a24cdfc96b089652fd1afb","types":"./build/index.d.ts","_nodeVersion":"22.11.0","_npmVersion":"11.2.0","dist":{"integrity":"sha512-2H59i5Weo9Fz81Sak3oFwvc6GInXRAjf/KDzoC41VH4SGCa/D7ojexeTVUx4QC8sBfe01ZjNeii8oMyqkWmubw==","shasum":"a6d29dcc075aa82a10048ed99c26741adc7f2200","tarball":"https://registry.npmjs.org/@apostel/node-canvas-core/-/node-canvas-core-1.2.0.tgz","fileCount":25,"unpackedSize":18725,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFsSJXq+foJ29rYnAJGQXf2lr4QCvtFoA8eK5uMp0dV6AiAKcuf0LRvWuqAAGr2h4qT/ggkWIJiT7hVGpdxOok7Grw=="}]},"_npmUser":{"name":"sam-apostel","email":"sam@apostel.be"},"directories":{},"maintainers":[{"name":"sam-apostel","email":"sam@apostel.be"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/node-canvas-core_1.2.0_1744977440813_0.6448196402965578"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-08T12:34:36.151Z","modified":"2025-04-18T11:57:21.162Z","1.0.0":"2025-04-08T12:34:36.467Z","1.1.0":"2025-04-15T15:46:41.396Z","1.1.1":"2025-04-16T14:15:18.425Z","1.2.0":"2025-04-18T11:57:20.975Z"},"bugs":{"url":"https://github.com/Sam-Apostel/nodl/issues"},"author":{"name":"Sam Apostel"},"license":"MIT","homepage":"https://github.com/Sam-Apostel/nodl#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/Sam-Apostel/nodl.git"},"description":"Core implementation of the @apostel/node-canvas framework","maintainers":[{"name":"sam-apostel","email":"sam@apostel.be"}],"readme":"# @apostel/node-canvas-core\n\nThe core implementation of the @apostel/node-canvas framework.\n\n### Getting Started\n\n#### Installation\n\n```\n# Using NPM\nnpm install @apostel/node-canvas-core\n\n# Using Yarn\nyarn add @apostel/node-canvas-core\n\n# Using Bun\nbun install @apostel/node-canvas-core\n```\n\n#### Additional dependencies\n\nMake sure to also install the following packages:\n\n```\n# Using NPM\nnpm install rxjs zod\n\n# Using Yarn\nyarn add rxjs zod\n\n# Using Bun\nbun install rxjs zod\n```\n\n### API\n\n#### Node\n\nNodes are units that consists of inputs and outputs. They're conceptually very similar to functions, with the difference that outputs may be multiple, compared to a function's single return value.\n\nAn Addition Node may for instance have two inputs and a single output, which computes the sum of the inputs.\n\n```typescript\nimport { z } from 'zod';\nimport { Node, Input, Output, schema } from '@apostel/node-canvas-core';\nimport { combineLatest, map } from 'rxjs';\n\n/** Declare a zod schema for value validation */\nconst NumberSchema = schema(z.number());\n\nclass Addition extends Node {\n    name = 'Addition';\n\n    inputs = {\n        a: new Input({ name: 'A', type: NumberSchema, defaultValue: 0 }),\n        b: new Input({ name: 'B', type: NumberSchema, defaultValue: 0 })\n    };\n\n    outputs = {\n        output: new Output({\n            name: 'Output',\n            type: NumberSchema,\n            observable: combineLatest([this.inputs.a, this.inputs.b]).pipe(\n                map(inputs => inputs.reduce((sum, value) => sum + value), 0)\n            )\n        })\n    };\n}\n```\n\n### Example\n\n```typescript\nimport { z } from 'zod';\nimport { Node, Input, Output, schema } from '@apostel/node-canvas-core';\nimport { combineLatest, map } from 'rxjs';\n\n/** Declare a zod schema for value validation */\nconst NumberSchema = schema(z.number());\n\nclass Addition extends Node {\n    name = 'Addition';\n\n    inputs = {\n        a: new Input({ name: 'A', type: NumberSchema, defaultValue: 0 }),\n        b: new Input({ name: 'B', type: NumberSchema, defaultValue: 0 })\n    };\n\n    outputs = {\n        output: new Output({\n            name: 'Output',\n            type: NumberSchema,\n            observable: combineLatest([this.inputs.a, this.inputs.b]).pipe(\n                map(inputs => inputs.reduce((sum, value) => sum + value), 0)\n            )\n        })\n    };\n}\n\n/** Declare 3 addition nodes */\nconst additionNode1 = new Addition();\nconst additionNode2 = new Addition();\nconst additionNode3 = new Addition();\n\n/** Connect them together */\nadditionNode1.outputs.output.connect(additionNode3.inputs.a);\nadditionNode2.outputs.output.connect(additionNode3.inputs.b);\n\n/**\n * The output of AdditionNode3 will fire with a new sum\n * everytime the inputs of AdditionNode1 and AdditionNode2 changes\n */\nadditionNode3.outputs.output.subscribe(console.log);\n```\n","readmeFilename":"README.md"}