# eng

> Nodejs MVC Framework

Latest version **0.0.9** (published 2014-05-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install eng
pnpm add eng
yarn add eng
bun add eng
```

Provides the command `eng`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2014-05-29 |
| First published | 2014-05-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ukungzulfah |
| Maintainers | ukungzulfah |
| Keywords | Framework, MVC, Nodejs |

## Links

- npm: https://www.npmjs.com/package/eng
- Repository: https://github.com/ukungzulfah/eng
- Issues: https://github.com/ukungzulfah/eng/issues
- npm.io page: https://npm.io/package/eng

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads
- [@modern-js/plugin-swc](https://npm.io/package/@modern-js/plugin-swc.md) — 3.4K weekly downloads

## Recent versions

- 0.0.9 (latest) — 2014-05-29
- 0.0.8 — 2014-05-29
- 0.0.7 — 2014-05-29
- 0.0.6 — 2014-05-29
- 0.0.5 — 2014-05-29
- 0.0.4 — 2014-05-29
- 0.0.3 — 2014-05-29
- 0.0.2 — 2014-05-29
- 0.0.1 — 2014-05-27

## README

eng
===

Eng Engine is a framework that uses the concept of MVC node.js


## Installation

**With [node](http://nodejs.org):**
```sh
# Get the latest stable release of Eng
$ sudo npm install eng -g // require -g
```

## Your First Eng Project

**Create a new Project:**
```sh
# Create the app
$ eng install // and follow instruction
```

**Next Run Project:**
```sh
# cd into the new folder
$ cd tester

# fire up the server
$ eng run // or node server.js
```


**Removing Project:**
```sh
$ eng uninstall project_name
```

## MVC Controller

**Application/Controll/home.js:**
```sh
	export.home = {
		
		home_index: function(){
			this.setContent("Hello World");
		}
		
	};
	
	// run: http://localhost:8080/home/ or http://localhost:8080/
```

**Create Controller Project:**
```sh
$ eng create_controller // and follor instruction example: test
```

**Eng will generate code:**
```sh
	export.test = {
		
		home_index: function(){
			this.setContent("Hello World");
		}
		
	};
	
	// run: http://localhost:8080/test/
```

**Create any method:**
```sh
	export.test = {
		
		home_index: function(){
			this.setContent("Hello World");
		}
		
		home_second: function(){
			this.setContent("Hello World second");
		}
		
	};
	
	// run: http://localhost:8080/test/second/
```

**Create __construct:**
```sh
	export.test = {
		
		name: '',
		
		__construct: function(){
			this.name = 'ukungzulfah';
		},
		
		home_index: function(){
			this.setContent("Hello " + this.name);
		}
		
	};
	
	// run: http://localhost:8080/test/
```

**Create autoload Model & Library:**
```sh
	export.test = {
		
		name: '',
		mylib: '',
		
		include: [
			{
				type: 'lib', // library autoload
				name: 'libs'
			},
			{
				type: 'model', // Model autoload
				name: 'user'
			}
		],
		
		__construct: function(){
			this.name = this.user.getUserName();
			this.mylib = this.libs.getLibName();
		},
		
		home_index: function(){
			this.setContent( this.name +" "+ this.mylib );
		}
		
	};
	
	
	// Create Model in Application/Model/user.js
	export.user = {
		getUserName: function(){ return 'ukungzulfah'; }
	};
	
	
	// Create Library in System/Lib/libs.js
	export.libs = {
		getLibName: function(){ return 'ukungzulfah'; }
	};
	
	// run: http://localhost:8080/test/
```


	
## MVC Model
> Create function for transaction with database [ mysql / mongodb / etc ] with modul from node.js and create function here


**Create Example Model:**
**Application/Model/user.js:**
```sh
	export.user = {
		getUserName: function(){ return 'ukungzulfah'; }
	};
```
**Example Call Model from Controller:**
```sh
	export.test = {
		
		home_index: function(){
			var self=this;
			self.model('user', function(){
				self.setContent( self.user.getUserName() );
			});
		}
		
	};
```


## MVC View
	
**Create view in format html in folder Application/View/ <view name> .html:**
**and you can include ejs here:**

**Create View Example:**
**Application/View/index.html:**
```sh
	<html>
	
		<head>
			<title> <%= title %> </title>
		</head>
		
		<body>
			<h1> <%= body %> </h1>
		</body>
		
	</html>
```
**Example Call View from Controller and send data to View:**
```sh
	export.test = {
		
		home_index: function(){
			var self=this;
			var data = {
				title: "Eng MVC Node.js",
				body: "Hello World"
			};
			
			self.view('index', function(content){
				self.setContent( content );
			}, data);
		}
		
	};
```


### [Group on G+](https://plus.google.com/u/0/communities/109310640158616232259) &nbsp; [Follow Twitter](https://twitter.com/ukungzulfah)

Thanks to Nodejs

Ukungzulfah

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