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

easyexpress

v0.5.8

Published

express app in easy way

Downloads

15

Readme

Easy Express (EE Framework)

A Node.js framework based on express.js to create an app in easy way. It is based on modular web application approach. Just like in some known PHP frameworks like ZendFramework, EE lets you create separate directories for each of your app's modules like "site", "admin" or "api".

npm version

Table of contents

[TOC]

Installation

  • Create an empty Node.js project.
  • Install the latest version of Easy Express from npm:
  npm install easyexpress
  • Initialise the project. This will set up new project structure as it is needed by the framework.
$ node_modules/.bin/easyexpress
  • Start the app with running simple node command:
$ node bin/www

That's all, click here to see the result

Project structure

Here is what file structure will be generated for a new EE project

Screen Shot 2015-03-26 at 12.39.59 PM.png

Auto generators

EE Framework provides useful commands to automatically generate site modules and controllers. Just run the commands from project directory.

Create Module

$ node_modules/.bin/easyexpress module=<moduleName>

For example, running this script with moduleName equal to admin (node_modules/.bin/easyexpress module=admin) will create folder admin with nested controllers, views and mids folders.

Create Controller in a Module

$ node_modules/.bin/easyexpress module=<moduleName> controller=<controllerName>

For example, running this script with moduleName equal to admin and controller=user (node_modules/.bin/easyexpress module=admin controller=user) will create folder admin with nested controllers, views and mids folders if it does not exist and add a controller called UserController with sampe index action.

DB integration

Mongodb and mongoose

The EE Framework is ready to work with mongoDb and mongoose. You can tell the project initiation script to automatically add a mongoose dependency with sample config files and models by passing additional argument.

$ node_modules/.bin/easyexpress mongoose=true

Or you can install the module manually by running

$ npm install mongoose

and uncommenting db configurations in application/config/config.ini file:

;=========MONGO==========
[mongo]
hosts = localhost:27017
dbname = dbname

[development.mongo]
hosts = localhost:27017
dbname = dbname

The mongoose can be used in controller actions or any other functions by simply requiring it with var mongoose = require('mongoose'). It is also attached to controllers and can be accessible by this.mongoose parameter.

GridFs

If you are using gridfs in your project you can install the gridfs-stream package either automatically or manually with the following commands:

  • Automatic
$ node_modules/.bin/easyexpress gridfs=true
  • Manual
$ npm install gridfs-stream

Models

The EE Framework works perfectly with usual mongoose models. It automatically loads any model found under models directory.

If you chose to auto-install mongoose during project init, you will find two sample mongoose models there (TestModel.js and FsFilesModel.js).

Afterwards if you want to create a model manually you should add a file in models directory with name ending with 'Model.js' (i.e. UserModel.js). Only these files will be automatically loaded by the framework.

redis

Install redis-client-wrapper package or redis

$ npm install redis-client-wrapper

or
$ npm install redis (for more info)

Tests

npm test

Contributing

Release History

  • 0.3.2 now mongoose and redisClient available from controller class. in action function call this.mongoose and this.redisClient bugs fixes
  • 0.1.0 Initial release