Skip to content

Latest commit

 

History

History
executable file
·
74 lines (52 loc) · 2.47 KB

readme.md

File metadata and controls

executable file
·
74 lines (52 loc) · 2.47 KB

node-std

The idea of this library is to provide you with all the essential building blocks you need to get your node on. Extensive. Consistent. Structured. Modular. Grab what you need; ignore the rest.

Like it? Don't like it? It's all about picking your poison. I've chosen an uncommon (unorthodox?) poison, but this library will be updated frequently, have many examples and documentation, and that's what matters.

Included libraries:

  1. core - Essentials. Mixin your way to victory!
  2. blog
  3. cms
  4. database - We all need a little persistency in our lives.
  5. debug - Write to me.
  6. forum
  7. framework - MVC? HMVC? MVVM? Your choice.
  8. site - Startup.
  9. wiki
  10. game
  11. ...more!

Installation

  1. Run this command: npm install node-std. If you don't have NPM installed, you can get it here, navigate to the node-std directory and run: npm install .
  2. Done!

Usage

var std = require('std').std;

var blog = std('import blog');

var p1 = blog.post();
p1.title = 'Hello world!';

Custom modules

  1. Install node-std if you haven't already.
  2. Create modules directory for your module.
  3. Create my_module directory.
  4. Add a __init__.js package file to your module directory.
  5. Add any exports to your package file that you may want to be accessible.
  6. You're ready to create your module's structure.

Add your modules to node-std's importer:

var std = require('std').std;
std.prototype.add_path('./modules');

var my_module = std('import my_module');

Important

The API is still under construction, and may experience highly volatile changes.

Contribute

You can find the library in the src directory, which is CoffeeScript compiled down to JavaScript in the lib directory.

Command to watch and compile:

  1. cd node-std
  2. node bake.js

Standard

Naming Convention

All code is to be lower-case using underscores for logical separation. Everything is lower-cased and underscored: variables, functions, classes, directories, files, event names, table names, and so on. We are aware JavaScript, and by consequence Node.js is traditionally pascal/camel case. Sorry.

Unit Testing

You can find existing unit tests in the test directory.

Projects using node-std

Credits

Major thanks to the CoffeeScript team.

Uses the following Node modules: backbone, underscore, connect, socket.io