# ute

> Unframework for node.js web application

Latest version **0.1.6** (published 2015-03-14) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2015-03-14 |
| First published | 2011-12-31 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.0 |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+9 in 4 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Cliffano Subagio |
| Maintainers | cliffano |
| Keywords | unframework, web application |

## Links

- npm: https://www.npmjs.com/package/ute
- Repository: http://github.com/cliffano/ute
- Issues: http://github.com/cliffano/ute/issues
- npm.io page: https://npm.io/package/ute

## Dependencies (6)

- [ejs](https://npm.io/package/ejs.md) ~2.2.4
- [nconf](https://npm.io/package/nconf.md) ~0.7.1
- [log4js](https://npm.io/package/log4js.md) ~0.6.22
- [express](https://npm.io/package/express.md) ~4.11.2
- [connect-domain](https://npm.io/package/connect-domain.md) ~0.5.0
- [express-partials](https://npm.io/package/express-partials.md) ~0.3.0

## Recent versions

- 0.1.6 (latest) — 2015-03-14
- 0.1.5 — 2014-12-06
- 0.1.4 — 2014-12-05
- 0.1.3 — 2014-11-03
- 0.1.2 — 2014-10-16
- 0.1.1 — 2014-06-06
- 0.1.0 — 2013-11-23
- 0.0.6 — 2013-03-04
- 0.0.5 — 2012-04-07
- 0.0.4 — 2012-04-06
- 0.0.3 — 2012-04-05
- 0.0.2 — 2012-01-05
- 0.0.1 — 2011-12-31

## README

<img align="right" src="https://raw.github.com/cliffano/ute/master/avatar.jpg" alt="Avatar"/>

[![Build Status](https://secure.travis-ci.org/cliffano/ute.png?branch=master)](http://travis-ci.org/cliffano/ute)
[![Dependencies Status](https://david-dm.org/cliffano/ute.png)](http://david-dm.org/cliffano/ute)
[![Coverage Status](https://coveralls.io/repos/cliffano/ute/badge.png?branch=master)](https://coveralls.io/r/cliffano/ute?branch=master)
[![Published Version](https://badge.fury.io/js/ute.png)](http://badge.fury.io/js/ute)
<br/>
[![npm Badge](https://nodei.co/npm/ute.png)](http://npmjs.org/package/ute)

Ute
---

Ute is an unframework for simple node.js web application.

This is handy if you want to run your web app by specifying route + environment configuration files and handler functions, with less repetitive boilerplate code.

Under the hood, Ute uses Express, EJS (with Partials), and nconf.

Installation
------------

    npm install ute

or as a dependency in package.json file:

    "dependencies": {
      "ute": "x.y.z"
    }

Usage
-----

Specify handler functions:

    function homeCb(req, res) {
      res.render('home.html', {
        layout: 'mylayout',
        locals: {
          name: 'Bob'
        }
      });
    }

    function dataCb(req, res) {
      res.json({ foo: 'bar' });
    }

Create a Ute instance and call start:

    var Ute = require('ute');
    var ute = new Ute();

    var handlers = { home: homeCb, data: dataCb }

    ute.start(handlers);

Place mylayout.html and home.html under views directory:

mylayout.html

    <html>
    <head><title>My Site</title></head>
    <body>
      <%- body %>
    </body>
    </html>

home.html

    Hello <%= name %>!

Configuration
-------------

Set application name and port in conf/<env>.json:

    {
      "app": {
        "name": "myapp",
        "port": 9000
      }
    }

Set [log4js](http://github.com/nomiddlename/log4js-node) configuration in conf/<env>-log4js.json, e.g.

    {
      "appenders": [
        {
          "type": "console"
        },
        {
          "type": "file",
          "filename": "someapp.log",
          "maxLogSize": 10240000,
          "backups": 10
        }
      ],
      "replaceConsole": true
    }

Set routes path and handler mappings in conf/routes.json:

    [
      { "method": "GET", "path": "/", "handler": "home" },
      { "method": "POST", "path": "/data", "handler": "data" }
    ]

Colophon
--------

[Developer's Guide](http://cliffano.github.io/developers_guide.html#nodejs)

Build reports:

* [Code complexity report](http://cliffano.github.io/ute/bob/complexity/plato/index.html)
* [Unit tests report](http://cliffano.github.io/ute/bob/test/buster.out)
* [Test coverage report](http://cliffano.github.io/ute/bob/coverage/buster-istanbul/lcov-report/lib/index.html)
* [API Documentation](http://cliffano.github.io/ute/bob/doc/dox-foundation/index.html)

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