Numeric Production Mechanism

    nerv

    0.3.0 • Public • Published

    NervJS

    • A tiny, pure, event-based model wrapper for the MVC or MDV (Model-driven Views) pattern.
    • It is far thinner than Backbone. None of View, Controller or Router is involved.
    • Strict data hiding but straightforward way to use.
    • Provides minimal built-in APIs but supports all external and conventional methods to access the model.
    • Model can be nested and supports bubbling events.

    In NodeJS

    npm install nerv
    

    In browser

    AMD and OzJS

    Get the code

    Add to your project as new dependency

    Or download directly from Github

    Dependencies

    Examples

    API and usage

    var nerv = require('nerv');

    nerv.Model

    var papercover = nerv();
    var hardcover = nerv({
        isHard: true
    });
    var pageModel = nerv.model({
        init: function(){...},
        defaults: {
            text: '',
            number: 0
        },
        mark: function(){...}
    });
    var page = pageModel({ number: 1 });
    var page2 = pageModel({ number: 2 });
    • page.each(function(member){}, context) --
    • page.get(key) --
    • page.data() --
    • page.data(key) --
    • page.set(key, function(value){ }, context) --
    • page.set(key, function(model){ }, context) --
    • page.set(key, value, context) --
    • page.set(key, model, context) --
    • page.set(function(agent){ }, context) --
    • page.set(model, context) --
    • page.remove(key) --
    • page.reset() --
    • page.find(value) --
    • page.find(model) --
    • page.setter(key, function(){}) --
    • page.observer --
      • API:
      • Event:
        • {key}:new --
        • {key}:update --
        • {key}:delete --
        • change --

    nerv.Collection

    var book = nerv([]);
    var bookB = nerv.collection({
        selectPage: function(number){...}
    });
    • book.add(value) --
    • book.add(model) --
    • book.size() --
    • Same as nerv.Model

    More References

    See OzJS Project Homepage

    Release History

    See OzJS Release History

    License

    Copyright (c) 2010 - 2013 dexteryy
    Licensed under the MIT license.

    Keywords

    none

    Install

    npm i nerv

    DownloadsWeekly Downloads

    4

    Version

    0.3.0

    License

    none

    Last publish

    Collaborators

    • dexteryy