# kalejs

> The node.js framework for developers who deliver.

Latest version **0.0.7** (published 2016-08-14) · MIT license · 0 weekly downloads

## Install

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

Provides the command `kale`.

## 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.7 |
| Published | 2016-08-14 |
| First published | 2015-07-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Matt Venables |
| Maintainers | venables |

## Links

- npm: https://www.npmjs.com/package/kalejs
- Repository: https://github.com/kalejs/kale
- Homepage: https://github.com/kalejs/kale#readme
- Issues: https://github.com/kalejs/kale/issues
- npm.io page: https://npm.io/package/kalejs

## Dependencies (6)

- [async](https://npm.io/package/async.md) ^1.5.0
- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^0.26.2
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [inflection](https://npm.io/package/inflection.md) ^1.8.0
- [underscore.string](https://npm.io/package/underscore.string.md) ^3.2.2

## Recent versions

- 0.0.7 (latest) — 2016-08-14
- 0.0.6 — 2015-11-29
- 0.0.5 — 2015-11-29
- 0.0.2 — 2015-07-26
- 0.0.1 — 2015-07-26

## README

# kale.js

The node.js framework for developers who deliver on time.

## What is it?

Kale.js is a set of lightweight, opinionated generators for building highly-scalable [koa](http://koajs.com/)-based node.js APIs with ease and speed.

Kale.js consists of 6 Generators:

* one to [build an app](#usage),
* one to [build a controller](#controller-generator),
* one to [build a model](#model-generator),
* one to [build a set of views](#view-generator),
* one to [build a migration](#migration-generator), and
* one to [build scaffolding](#scaffold-generator).

Overall, Kale.js builds apps that are fast, easy-to-read, and follow industry best practices.

A Kale.js application:

* Built on [koa](http://koajs.com/) and makes heavy use of ES6 Promises.
* Uses [bookshelf.js](http://bookshelfjs.org/) for an ORM.
* Backed by [Postgresql](http://www.postgresql.org/) by default.
* Includes basic single-page-app using [AngularJS](https://angularjs.org/), installed with [bower](http://bower.io/).
* Includes an asset pipeline using [Broccoli](http://broccolijs.com/) with development file watching and reload.
* Front-end javascript uses [browserify](http://browserify.org/) for node-style `require` statements.
* Sets up [Gulp](https://github.com/gulpjs/gulp) with basic [linting with jshint](https://github.com/jshint/jshint) and [code-style checking with jscs](https://github.com/jscs-dev/node-jscs)
* Front-end stylesheets are compiled with [SASS/SCSS](http://sass-lang.com/).
* Generates models with UUIDs as the primary key by default.
* Is a stateless, secure JSON API.
  * Does not include cookies or cookie-based sessions by default (so no need for CSRF protection)
* Security headers provided by [helmet](https://github.com/venables/koa-helmet), and [CORS](https://github.com/koajs/cors).
* Includes environment-specific config according to [the 12-factor app](http://12factor.net/) methodology.
* Includes a [Procfile](https://devcenter.heroku.com/articles/procfile) for easy deployment to heroku.

## Installation

```
npm install -g kalejs
```

## Usage

To start a new project, simply run `kale new <project_name>`, for example:

```
kale new example-app
```

This will build a new kale.js app in `./example-app`.

From the root of the new project, run `./bin/setup`, then `npm start` and you'll have a server running.

The app structure will look like:

```
app/
  assets/             <-- front-end app (Angular)
    bower_components  <-- bower-based installed assets
    images/           <-- static images
    javascripts/      <-- static js files
    stylesheets/      <-- static css (less) files
    views/            <-- static html page

  controllers/        <-- API controllers
  middleware/         <-- API middleware
  models/             <-- Bookshelf models

  index.js            <-- app entry point
  routes.js           <-- API routes

bin/                  <-- binary files

config/               <-- app config
  environments/       <-- environment specific config

db/                   <-- database config, initialization
  migrations/         <-- database migrations

public/               <-- static/public files live here
  assets/             <-- asset pipeline compiles app/assets to this directory

test/                 <-- tests
```

## Generators

kale.js comes equipped with a several generators to speed up development:

### Model Generator

```
kale generate model Thing
```

This will create a new `Thing` model (referencing a `things` table) named `thing.js` in the `app/models` directory.

This will also create an empty migration named `<timestamp>_create_things.js` in the `db/migrations` directory.

### Controller Generator

```
kale generate controller users
```

This will create a new RESTful controller named `users` in the `app/controllers` directory.

The controller contains `index`, `show`, `create`, `update`, and `destroy` methods, as well as their routes.

### View Generator

```
kale generate view users
```

This will create a new set of AngularJS views under `/users` in `app/assets/views` and `app/assets/javascripts`.

### Migration Generator

```
kale generate migration create_users
```

This will create a new migration named `<timestamp>_create_users.js` in `db/migrations` directory.


### Scaffold Generator

```
kale generate scaffold User
```

This will run the model, migration and controller generators for a new `User` model.

## Examples

To generate a simple Blog API, type the following:

```
npm install -g kalejs
kale new blog
cd blog
./bin/setup
kale generate scaffold Posts
kale migrate
npm start
```

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