new NodeCG(bundle, socket)
Creates a new NodeCG API instance. It should never be necessary to use this constructor in a bundle, as NodeCG automatically injects a pre-made API instance.
|bundle||object||The bundle object to build an API instance from.|
|socket||object||The Socket.IO socket instance to communicate with.|
An object containing references to all Replicants that have been declared in this
window, sorted by bundle. E.g.,
An object containing the parsed content of cfg/<bundle-name>.json, the contents of which are read once when NodeCG starts up. Used to quickly access per-bundle configuration properties.
Provides information about the current git status of this bundle, if found.
|branch||String||What branch this bundle is on.|
|hash||String||The full hash of the commit this bundle is on.|
|shortHash||String||The short hash of the commit this bundle is on.|
|date||Date||<optional>||The date of the commit this bundle is on.|
|message||String||<optional>||The message of the commit this bundle is on.|
The name of the bundle which this NodeCG API instance is for.
The version (from package.json) of the bundle which this NodeCG API instance is for.
This can only be used in code which runs on the server.
Object containing references to all other loaded extensions. To access another bundle's extension, it must be declared as a bundleDependency in your bundle's manifest.
Provides easy access to the Logger class. Useful in cases where you want to create your own custom logger.