engine-app
Engine app related helper functions.
Installation
$ npm i --save engine-app
Example
const EngineApp = ; // Initialize the appvar myApp = __dirname + "/example-app"; // Create the packagemyApp console;// => { name: 'example-app' } // Create the layout instancemyApp;
Documentation
EngineApp(adapter)
Creates a new instance of EngineApp
.
Params
- String|CompositionAdapter
adapter
: The path to the application or the adapter object.
getPackage(cb)
Gets the package.json content.
Params
- Function
cb
: The callback function.
Return
- Object The
package.json
content as json (if called without a callback function).
setPackage(data, cb)
Sets the package.json content.
Params
- Object
data
: The data to set in the file. - Function
cb
: The callback function.
getModulePackage(name)
Reads the module package.json
file.
Params
- String
name
: The module name.
Return
- Object The
package.json
content as json (if called without a callback function).
setModulePackage(name, data)
Writes the module package.json
file.
Params
- String
name
: The module name. - Object
data
: The data to set in the file.
createInstance(name, data, cb)
Creates a new instance.
Params
- String
name
: The instance name. - Object
data
: The instance content. - Function
cb
: The callback function.
readInstance(name, cb)
Gets the instance content.
Params
- String
name
: The instance name. - Function
cb
: The callback function.
updateInstance(name, data, cb)
Updates an instance.
Params
- String
name
: The instance name. - Object
data
: The instance content. - Function
cb
: The callback function.
removeInstance(name, cb)
Removes an instance.
Params
- String
name
: The instance name. - Function
cb
: The callback function.
listInstance(cb)
listInstances List instances.
Params
- Function
cb
: The callback function.
getAllnstances(cb)
getAllInstances Read all instances.
Params
- Function
cb
: The callback function.
renameInstance(oldName, newName, cb)
Renames the specified instance.
Params
- String
oldName
: The old instance name. - String
newName
: The new instance name. - Function
cb
: The callback function.
upsertInstance(name, data, cb)
Creates or updates the specified instance.
Params
- String
name
: The instance name. - Object
data
: The instance content. - Function
cb
: The callback function.
How to contribute
Have an idea? Found a bug? See how to contribute.
Where is this library used?
If you are using this library in one of your projects, add it in this list. ✨