Build reusable Noderyx extensions with ordinary JavaScript modules and npm conventions—no plugin runtime, no proprietary format.
01
What a package is
A Noderyx package is an ES module that exports a provider. It can register routes, middleware, error handling, and services, and it can run startup work—without changing the framework core or your application's source files.
Local packages live under packages/ and load automatically.
Published packages install from npm and are enabled explicitly in noderyx.config.js.
Both use the same provider shape, so a local package can be published unchanged.
Packages use the public framework API only, which is what keeps them working across releases.
02
Create a local package
The generator writes a complete, runnable package, including an example route.
Restart the development server afterwards, then open http://localhost:3000/hello-world.
03
The provider
definePackage() validates the provider early—so a typo fails at startup with a clear message—and returns it unchanged.
packages/hello-world/src/index.js
import { definePackage } from "noderyx-framework";
export default definePackage({
name: "hello-world",
register({ app, options }) {
app.get("/hello", ({ json }) => json({
message: options.message ?? "Hello from the package"
}));
},
async boot({ name }) {
console.log(`Loaded ${name}`);
}
});
04
Lifecycle
A provider has two optional methods. register() adds routes, middleware, and error handling; boot() runs after every enabled package has registered, which is where cross-package work belongs. Both may be asynchronous.
Registration happens in configured order; local packages are discovered before configured ones run.
Booting happens afterwards, in the same order.
Anything that needs another package to exist belongs in boot(), not register().
05
The lifecycle context
Both methods receive the same object.
appThe active application instance.
nameThe provider's package name.
optionsApplication-specific options from noderyx.config.js.
configThe full Noderyx configuration.
rootAbsolute path to the application root.
06
Register routes
Packages use exactly the same routing methods as applications. Prefix your paths so two packages cannot collide, and so an application can predict what a package added.
Application routes are registered before loadPackages(), so a user route always wins over a package route on the same path.
07
Register middleware and services
Middleware from a package behaves like any other middleware. Services registered with app.provide() become available to the whole application through service(name).
Do not change global prototypes or reach into undocumented framework internals—that is what breaks on the next release.
08
Package options
Local packages load with an empty options object. Configured packages receive whatever the application passes, and a provider should validate what it depends on.
Explicit activation is deliberate: an unrelated dependency in node_modules never runs startup code merely because it is installed.
11
Install a published package
Install with npm, then enable it. Two steps, both visible in your repository history.
TERMINAL
npm install @acme/noderyx-reports
Note
Then add it to the packages array: packages: ["@acme/noderyx-reports"].
12
Prepare a package for npm
Change the generated manifest from private local development to a publishable package. Keep noderyx-framework as a peer dependency so the application owns one framework version instead of installing a second copy inside the package.