Skip to content
/ yojs Public

Javascript library for declaring and calling functions and variables using namespaces.

Notifications You must be signed in to change notification settings

codus/yojs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

yojs

Javascript library for declaring and calling functions and variables using namespaces.

Usage

Function definition:

yojs.define("yojs_test", function() {
  //your code goes here
});

yojs.define("yojs_test.comments.new", function() {
  //your code goes here
});

Function call:

yojs.call("yojs_test");

yojs.call("yojs_test.comments.new");

Store objects and values:

yojs.set("yojs_test.my_value", 42);
yojs.set("yojs_test.ns2.n3.my_json", { foo: "bar"} );

Retrieve stored object and values:

var value = yojs.get("yojs_test.my_value");
var json = yojs.get("yojs_test.ns2.n3.my_json");

Check if something is defined:

yojs.isDefined("yojs_test.ns1.ns2.var");
yojs.isDefined("yojs_test.ns1.ns2.function");

Namespace lookup:

yojs.define("my.deep.namespace.teste", function() {
  yojs.call("itworks");
});

yojs.define("my.deep.namespace.itworks", function() {
  console.log("yay");
});

yojs.call("my.deep.namespace.teste") // -> yay

About

Javascript library for declaring and calling functions and variables using namespaces.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published