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 🙏

© 2025 – Pkg Stats / Ryan Hefner

nodeignitermvc

v0.1.0

Published

Node MVC framework inspired by Codeigniter

Readme

nodeigniterMVC

NodeigniterMVC - an MVC framework for node.js inspired by Codeigniter. It allows custom routing, chaining, and partial view rendering; built-in with helpers, libraries, and a CLI. Fully compatible with Bower.

Dependencies:

  • connect
  • commander
  • connect

CI-based URL structure

http://www.domain.com/[controller]/[function]/[param1]/[param2]/[etc]

Via NPM:

npm install nodeignitermvc
nodeigniter create <appname>
node app.js

Use inside application:

var ni = require('nodeigniter');

Customize the autoload in app/config/autoload.js

// currently available helpers
this.helpers = ['security','array','url', 'string', 'html', 'form'];

//or load the helper in the controller

ni.load_helper('array');
//OR
ni.load_helper(['array', 'url']);

Custom routing in app/config/routes.js

// set your custom routes here
this.route = [
    {src: '/sign_up', dest: '/main/sign_up', method: ['GET','POST']},
    {src: '/sign_in', dest: '/main/sign_in', method: ['GET','POST']}
];

Setting config variables

// config variable setting
var ni = require('nodeigniter');

//setter
ni.config('some-name', 'value');

//getter
var val = ni.config('some-name');

Accessing helpers

// config variable setting
var ni = require('nodeigniter');

//from url helper
ni.fn.site_url();


//from html helper
ni.fn.anchor();


//to view availabe functions
console.log(ni.fn);

Form validation:

// config variable setting
var ni = require('nodeigniter');

//validation library
ni.load_librray('validation');

//set the rules - same with codeigniter
ni.validation.set_rules('name', 'display', 'required|valid_email|max_length[30]');

//to execute
if (ni.validation.run()) {
    some function
} else {
    some function
}

//writing form fields to the view and setting the values

{{= 
    form_open('') + 
    form_input('name', set_value('name'), {class: 'someclass', maxlength: 30}) + 
    form_submit('submit', 'Submit')
}}


//accessing the request variables

var username = ni.input.req_vars.username;
var password = ni.fn.sha1(ni.input.req_vars.password);

//you can also use any functions

Loading views--uses the ejs templating system:

// setting the partial pages and render, allows chaining

var ni = require('nodeigniter');

// file should be located in the views folder under app: app/views
ni.partial('main.ejs').render();

//you can also put the file into a sub folder
ni.partial('subfolder/main.ejs').render();

//or this
ni.partial('section/header.ejs').partial('subfolder/main.ejs').render();

view exaample app/views/section/header.ejs

{{= doctype('html5') }}
<html lang="en">
    <head>
        <title>Nodeigniter - Fast and flexible node framework</title>
        {{= link_tag('css/bootstrap.min.css?timestamp='+Number(new Date())) }}
        {{= link_tag('css/custom.css?timestamp='+Number(new Date())) }}
        {{= script_tag('js/jquery-1.4.6.min.js?timestamp='+Number(new Date())) }}
        {{= script_tag('js/jquery.tmpl.js?timestamp='+Number(new Date())) }}
    </head>

//use the curly braces
{{= some_function or some vars }}