npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kalejs

v0.0.7

Published

The node.js framework for developers who deliver.

Downloads

10

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-based node.js APIs with ease and speed.

Kale.js consists of 6 Generators:

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

A Kale.js application:

  • Built on koa and makes heavy use of ES6 Promises.
  • Uses bookshelf.js for an ORM.
  • Backed by Postgresql by default.
  • Includes basic single-page-app using AngularJS, installed with bower.
  • Includes an asset pipeline using Broccoli with development file watching and reload.
  • Front-end javascript uses browserify for node-style require statements.
  • Sets up Gulp with basic linting with jshint and code-style checking with jscs
  • Front-end stylesheets are compiled with SASS/SCSS.
  • 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, and CORS.
  • Includes environment-specific config according to the 12-factor app methodology.
  • Includes a 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