0.3.2 • Published 9 years ago

nk v0.3.2

Weekly downloads
7
License
Apache-2.0
Repository
github
Last release
9 years ago

nodakwaeri ( nk ) Donate via PayPal.com

A simple, yet powerful, and fully-featured cross-platform application framework for Node.js.

Unless you are only planning on using a few pieces of nodakwaeri and intend to use custom facilities, it's recommended that you install nodakwaeri via the nk-mvc or nk-xrm project template. There is more in-depth documentation available for nk-mvc which covers all aspects of the framework, and provides an excellent starting place for any nodakwaeri application. The nk-xrm repository may also provide more advanced resources, examples, and documentation for working with nodakwaeri as progress is made.

To install the nodakwaeri module, use npm as shown below in either terminal/shell or command prompt. Be sure to have Node.js and Git installed, with the latter's root directory in your systems environment path.

path_to_app/> npm install nk
var nk = require( 'nk' );
nk = new nk();
...

Below describes some general usage of nodakwaeri. Browsing the source will also prove to be a good way to get to know the nk toolset, as well as visiting the nodakwaeri wiki @ Github.

When one desires to check the type of a variable, consider the following snippet:

...
if( nk.type( obj ) !== 'function' )
{
    // Do what you will
} 
...

When extending objects and/or arrays, they can be of either type. Default behaviors occur when extending like types.

Objects:

var obj1 = { 'First': 1, 'Second': 2, 'Fourth': 4 };
var piece3 = { 'Third': 3 };

obj1 = nk.extend( obj1, piece3 );

for( var prop in obj1 )
{
    console.log( 'Key:' + prop + ', Value: ' + obj1[prop] + '.' );
}
/> Key: First, Value: 1.
/> Key: Second, Value: 2.
/> Key: Fourth, Value: 4.
/> Key: Third, Value: 3.
var arr1 = [ 1, 2, 4 ];
var piece3 = [ 3 ];

arr1 = nk.extend( arr1, piece3 );

for( var prop in arr1 )
{
    console.log( 'Key:' + prop + ', Value: ' + arr1[prop] + '.' );
}
/> Key: 0, Value: 1.
/> Key: 1, Value: 2.
/> Key: 2, Value: 4.
/> Key: 3, Value: 3.

Arrays with Objects (Non-default):

var arr1 = [ 1, 2, 4 };
var piece3 = { '3': 3 };

arr1 = nk.extend( arr1, piece3, false );

for( var prop in arr1 )
{
    console.log( 'Key:' + prop + ', Value: ' + obj1[prop] + '.' );
}
/> Key: 0, Value: 1.
/> Key: 1, Value: 2.
/> Key: 2, Value: 4.
/> Key: 3, Value: 3.

Extending an Object with an array works the same as the above, but has no 'non-default' behavior:

var obj1 = { 'First': 1, 'Second': 2, 'Fourth': 4 };
var piece3 = [ 3 ];

obj1 = nk.extend( obj1, piece3 );

for( var prop in obj1 )
{
    console.log( 'Key:' + prop + ', Value: ' + obj1[prop] + '.' );
}
/> Key: First, Value: 1.
/> Key: Second, Value: 2.
/> Key: Fourth, Value: 4.
/> Key: 0, Value: 3.

One of our jQuery favorites is an absolute must:

var obj1 = { 'First': 1, 'Second': 2, 'Fourth': 4 };
var piece3 = { 'Third': 3 };

obj1 = nk.extend( obj1, piece3 );

nk.each
(
    obj1,
    function( k, v )
    {
        console.log( 'Key:' + k + ', Value: ' + v + '.' );
    } 
);
/> Key: First, Value: 1.
/> Key: Second, Value: 2.
/> Key: Fourth, Value: 4.
/> Key: Third, Value: 3.

nodakwaeri also provides all of the facilities one might need to create an application. This includes:

FactoryPurpose
ServerDefines and initialises the http server, listening for incoming client connections. Utilizes the session and router factories.
SessionCreates and manages all client sessions to provide persistence for the end user. Protects against 'Session Take-over' and 'Session Injection' techniques. Provides tools to the developer for manipulating the session.
RouterDetects and processes media requests from the browser and/or routes client requests to the proper controller for further processing.
SCJL (Cryptography)nodakwaeri is bootstrapped with The Stanford Javascript Crypto Library, via their BSD License.
ControllerImplements the MVC design pattern. Invokes the derived controller requested. Developers define the application's controllers.
ModelImplements the MVC design pattern. Provides the interface to the data integration tools and database object. Developers define the application's models.
RendererImplements the MVC design pattern. Constructs XHTML for the response to the client, provides a fully featured scripting language for templating, and allows for shared layouts and powerful organization. Developers define the application's views.
HTMLProvides tools for generating commonly used HTML5 controls in Accessible Rich Internet Applications (ARIA).

As a side note, by default nk-mvc makes uses of nodamysql (nk-mysql) as a database provider, and uses Bootstrap(which includes Normalize) and jQuery via CDN.

nodakwaeri is designed to work out of the box using a config file from the root of your application:

var nk = require( 'nk' ),
config = require( './config' ),
app = new nk( config );

app.init();
// Your application is now running...

Feel free to fork the repository and submit pull requests. Browse any of our other repositories as well MMOD @ Github.

You may also contribute by making a donation
Donate via PayPal.com

Eclipse Luna

Nodeclipse (Eclipse Marketplace, site)

Node.js

0.4.10

9 years ago

0.4.9

9 years ago

0.4.8

9 years ago

0.4.7

9 years ago

0.4.6

9 years ago

0.4.5

9 years ago

0.4.4

9 years ago

0.4.3

9 years ago

0.4.2

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.2.5

9 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.4-alpha

10 years ago

0.0.3-alpha

10 years ago

0.0.2

10 years ago