1.0.1 • Published 8 years ago

muchencute-jnamespace v1.0.1

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

jnamespace.js

Manage classes with namespaces for non-conflict declaring and importing in JavaScript

Build status npm npm

What to use it for?

In JavaScript, jnamespace.js has been used to organize classes & modules, and it grows.

Installation

There are many ways to install jnamespace.js but we suggest using npm or Bower.

npm install muchencute-jnamespace --save

or

bower install muchencute-jnamespace --save

Alternative installation

Basic usage

Assuming you have already installed jnamespace.js.

var namespace = jNamespace.using('com.muchencute.test');

var someClass = namespace.defineClass('SomeClass', function (someArg) {
    this.someField = someArg || '';
    this.someMethod = function (num) {
        return 'someMethod: ' + num;
    };
});
someClass.prototype.constructor = someClass;
someClass.prototype.somePrototypeMethod = function (num) {
    return 'somePrototypeMethod: ' + num;
};
someClass.someStaticMethod = function (num) {
    return 'someStaticMethod: ' + num;
};

Community

Copyright and license

jnamespace.js is release under the MIT license.

Copyrights belongs to 湖南牧米网络科技有限公司