Overview
JavaScript offers the fastest path to building Noorle plugins. Using ComponentizeJS, you can compile standard JavaScript directly to WebAssembly components without a separate build toolchain.JavaScript plugins share the same ComponentizeJS toolchain as TypeScript. If you prefer type safety, see the TypeScript guide.
Prerequisites
- Node.js 18+ installed
- Noorle CLI installed and authenticated
- Basic familiarity with the plugin project structure
Quick Start
package noorle:plugin;
world plugin {
export tool: interface {
call: func(name: string, input: string) -> string;
list: func() -> string;
}
}
export const tool = {
list() {
return JSON.stringify([
{
name: "hello",
description: "Returns a greeting",
inputSchema: {
type: "object",
properties: {
name: { type: "string", description: "Name to greet" }
},
required: ["name"]
}
}
]);
},
call(name, input) {
const args = JSON.parse(input);
switch (name) {
case "hello":
return JSON.stringify({
content: [{ type: "text", text: `Hello, ${args.name}!` }]
});
default:
return JSON.stringify({
error: `Unknown tool: ${name}`
});
}
}
};
schema_version: "1.0"
metadata:
name: my-js-plugin
description: A simple greeting plugin
version: 0.1.0
Working with External Data
JavaScript plugins can process and transform data:Error Handling
Return structured errors so agents can understand what went wrong:JavaScript vs TypeScript
| Aspect | JavaScript | TypeScript |
|---|---|---|
| Setup | Simpler — no compile step for source | Requires tsc before componentize |
| Type safety | None — runtime errors only | Compile-time type checking |
| Toolchain | jco componentize directly | tsc → jco componentize |
| Best for | Quick prototyping, simple tools | Production plugins, complex logic |
Limitations
Next Steps
Configuration
Full noorle.yaml reference
Permissions
Configure network and filesystem access
Publishing
Upload and version your plugin
TypeScript Guide
Add type safety to your plugin