The interface ✎
Our main module is a factory which takes two optional arguments:
const cwd = process.cwd();
const argv = process.argv.slice(2);
const Grown = require('grown')(cwd, argv);
If no arguments are given both values will be taken from the current
process
.
Extensions
Once created, the Grown
function behaves like a container, it can be called to
store and retrieve definitions from it.
// register an extension
Grown('Application', {
name: 'Example',
});
// both calls are equivalent
console.log(Grown.Application.name);
console.log(Grown('Application.name'));
Instances
Invoking new Grown()
will return a Server instance.
Behind scenes, the main module
grown
is a wrapper of@grown/bud
and@grown/server
➯ Next: APIs ⟩ Command line