# engine-app

> Engine app related helper functions.

Latest version **1.1.0** (published 2016-02-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install engine-app
pnpm add engine-app
yarn add engine-app
bun add engine-app
```

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2016-02-15 |
| First published | 2015-12-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | jillix |
| Maintainers | ionicabizau |
| Keywords | engine, app, helper, functions |

## Links

- npm: https://www.npmjs.com/package/engine-app
- Repository: https://github.com/jillix/engine-app
- Homepage: https://github.com/jillix/engine-app#readme
- Issues: https://github.com/jillix/engine-app/issues
- npm.io page: https://npm.io/package/engine-app

## Dependencies (6)

- [abs](https://npm.io/package/abs.md) ^1.2.1
- [r-json](https://npm.io/package/r-json.md) ^1.2.1
- [w-json](https://npm.io/package/w-json.md) ^1.3.1
- [is-there](https://npm.io/package/is-there.md) ^4.3.1
- [engine-paths](https://npm.io/package/engine-paths.md) github:jillix/engine-paths
- [engine-composition-crud](https://npm.io/package/engine-composition-crud.md) github:jillix/engine-composition-crud

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2016-02-15
- 1.0.0 — 2015-12-04

## README

# engine-app [![Version](https://img.shields.io/npm/v/engine-app.svg)](https://www.npmjs.com/package/engine-app) [![Downloads](https://img.shields.io/npm/dt/engine-app.svg)](https://www.npmjs.com/package/engine-app)

> Engine app related helper functions.

## Installation

```sh
$ npm i --save engine-app
```

## Example

```js
const EngineApp = require("engine-app");

// Initialize the app
var myApp = new EngineApp(__dirname + "/example-app");

// Create the package
myApp.setPackage({
    name: "example-app"
})

console.log(myApp.getPackage());
// => { name: 'example-app' }

// Create the layout instance
myApp.createInstance("layout", (err, data) => {

    // Read the layout instance
    myApp.readInstance("layout", (err, data) => {
        console.log(err || data);
        // => { name: 'layout' }
    });
});
```

## 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][contributing].

## Where is this library used?
If you are using this library in one of your projects, add it in this list. :sparkles:

## License

[MIT][license] © [jillix][website]

[license]: http://showalicense.com/?fullname=jillix%20%3Ccontact%40jillix.com%3E%20(http%3A%2F%2Fjillix.com)&year=2015#license-mit
[website]: http://jillix.com
[contributing]: /CONTRIBUTING.md
[docs]: /DOCUMENTATION.md

---
_Source: https://npm.io/package/engine-app · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
