Created
July 13, 2012 14:12
-
-
Save ralt/3105113 to your computer and use it in GitHub Desktop.
Trying to understand ncore...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ncore = require( 'ncore' ); | |
ncore.constructor( { | |
"./other.js": { | |
"test": "./test.js" | |
} | |
}); | |
console.log( ncore ); | |
ncore.add( 'test', require( './test.js' ) ); | |
ncore.add( 'other', require( './other.js' ) ); | |
console.log( ncore ); | |
ncore.init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ [Function: NCore] | |
constructor: [Function], | |
add: [Function], | |
init: [Function], | |
proxies: {}, | |
_modules: {}, | |
_interfaces: {}, | |
dependencies: { './other.js': { test: './test.js' } } } | |
{ [Function: NCore] | |
constructor: [Function], | |
add: [Function], | |
init: [Function], | |
proxies: | |
{ test: | |
{ once: [Function], | |
constructor: [Function], | |
emit: [Function], | |
removeListener: [Function], | |
setMaxListeners: [Function], | |
on: [Function], | |
removeAllListeners: [Function], | |
listeners: [Function], | |
addListener: [Function], | |
sayHi: [Function: proxy], | |
init: [Function: proxy] }, | |
other: | |
{ once: [Function], | |
constructor: [Function], | |
emit: [Function], | |
removeListener: [Function], | |
setMaxListeners: [Function], | |
on: [Function], | |
removeAllListeners: [Function], | |
listeners: [Function], | |
addListener: [Function], | |
init: [Function: proxy] } }, | |
_modules: | |
{ test: { init: [Function], sayHi: [Function], emit: [Function] }, | |
other: { init: [Function], emit: [Function] } }, | |
_interfaces: | |
{ test: { sayHi: [Function], init: [Function] }, | |
other: { init: [Function] } }, | |
dependencies: { './other.js': { test: './test.js' } } } | |
hi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
init: function() { | |
this.test.sayHi(); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
init: function() { | |
console.log( 'hi' ); | |
}, | |
sayHi: function() { | |
console.log( 'Lol I said hi!' ); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment