You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

npmvc

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npmvc - npm Package Compare versions

Comparing version

to
1.0.3

22

package.json
{
"name": "npmvc",
"version": "1.0.2",
"version": "1.0.3",
"description": "PureMVC for node.js",

@@ -13,4 +13,13 @@ "engines": {

"name": "Robbert Streng",
"email": "robbert@buiswerk.info"
"email": "rstreng2009@gmail.com"
},
"homepage": "https://github.com/rstr74/npmvc",
"repository": {
"type": "git",
"url": "https://github.com/rstr74/npmvc.git"
},
"licenses": [{
"type": "MIT",
"url": "http://opensource.org/licenses/mit-license.php"
}],
"dependencies": {},

@@ -29,8 +38,3 @@ "keywords": [

"lib": "./lib"
},
"readme": "### Modification of the [multicore javascript](https://github.com/PureMVC/puremvc-js-multicore-framework/wiki) port for use in a node.js environment.\n\nThis is the npm repo npmvc -> short for node-puremvc. I needed a short name because it is the main dependecies for other modules that are build on this module.\n\n#install\n\n```\nnpm install npmvc\n```\n\n#setup a puremvc project in node.js\n\nWhen installed you can use it like this\n```js\n\nvar puremvc = require(\"npmvc\");\n\npuremvc.setSourceDir(__dirname+\"/src\");\npuremvc.include(\"AppConstants\");\npuremvc.include(\"ApplicationFacade\");\n\n// make instance of ApplicationFacade and trigger start command\nvar app = new test.ApplicationFacade();\napp.start();\n\nconsole.log(test);\nconsole.log(puremvc.define);\n\n```\n\n#Creating external class files\n```js\nmodule.exports = function(include,puremvc) {\n\n// use include te aquire dependencies\ninclude(\"controller/StartCommand\");\n\n// ---> now just use puremvc.define to define class\n/**\n * @class test.ApplicationFacade\n * @extends puremvc.Facade\n */\npuremvc.define(\n\t{\n\t\tname: 'test.ApplicationFacade',\n\t\tparent: puremvc.Facade\n\t},\n\t{\n\t\t/**\n\t\t * @method start\n\t\t * @return {[type]} [description]\n\t\t */\n\t\tstart: function() {\n\n\t\t\tthis.registerCommand(\"START\", test.controller.StartCommand);\n\t\t\tthis.sendNotification(\"START\", {});\n\t\t}\n\t},\n\t{\n\t\t/**\n\t\t * Retrieve an instance of ApplicationFacade. If one has not yet been\n\t\t * instantiated, one will be created for you.\n\t\t *\n\t\t * @static\n\t\t * @param {string} multitonKey\n\t\t * @return test.ApplicationFacade\n\t\t */\n\t\tgetInstance: function(multitonKey) {\n\t\t\t// all Facade instances, including Facade subclass instances, are stored\n\t\t\t// on Facade.instanceMap. When implementing you own #getInstance factory\n\t\t\t// method, ensure that follow the general pattern implemented here or else\n\t\t\t// puremvc.Facade#hasCore and puremvc.Facade#removeCore will not work if\n\t\t\t// you ever need to use them.\n\t\t\tvar instanceMap = puremvc.Facade.instanceMap;\n\t\t\tinstance = instanceMap[multitonKey]; // read from the instance map\n\n\t\t\tif (instance) // if there is an instance...\n\t\t\t\treturn instance; // return it\n\n\t\t\t// otherwise create a new instance and cache it on Facade.instanceMap;\t\n\t\t\treturn instanceMap[multitonKey] = new test.ApplicationFacade(multitonKey);\n\t\t},\n\n\t\t/**\n\t\t * @static\n\t\t * @type {string}\n\t\t */\n\t\tNAME: 'test.ApplicationFacade'\n\t})\n};\n```\n\n\n#Extra methods:\nThis module adds three exra methods to the ```puremvc``` root object:\n\n##puremvc.setSourceDir(path:string):void\n**path [string]** Sets the source dir for all include's, It uses this for includes on all directory levels. So when you include a dependencie in say ```model/MyProxy``` you have to reference ```model/vo/MyVo``` by using the path up from the sourceDir, not relative to the folder the file is in: \n\n```\npuremvc.include(\"model/vo/MyVo\");\n```\n\nIf you have to hack this, you can use **tempPath**, the second param of puremvc.include. See below.\n\nAlso not that if you do not set the sourceDir it will default to ```process.cwd()``` (the directory where you started the main node file).\n\n----\n##puremvc.include(path:String, tempPath:String, callback:function):*\n\nReturns any value, but mainly use for return the reference to the classlets constructor from pure.define.\n\n**path [string]**\n\n Path to puremvc class, relative from path set by **puremvc.setSourceDir**\n\n**tempPath [String]**\nThis overides the sourceDir. A include of ```MyVo``` in class ```model/vo/MyVo``` would look like this:\n\n```\npuremvc.include(\"vo/MyVo\",__dirname);\n```\n\n**callback [function]**\nYou can use an callback, but you have to trigger it in the aquired class file.\n\nYou can **include a class in an other npm module** if the file is not equal in the context of your current sourceDir path. So when you want to load the class ```SomeClass``` in the module ```my-npm-module``` then do not use tempPath but use:\n\n```\npuremvc.include(\"my-npm-module/path/to/SomeClass\");\n```\n\n\n----\n##puremvc.getSourceDir():string\nreturns the current sourceDir\n",
"readmeFilename": "readme.md",
"_id": "npmvc@1.0.1",
"_shasum": "2c234c9b856c050829c0d495c35a4706a8888cf4",
"_from": "npmvc@>=1.0.1"
}
}
}

@@ -1,5 +0,14 @@

### Modification of the [multicore javascript](https://github.com/PureMVC/puremvc-js-multicore-framework/wiki) port for use in a node.js environment.
#PureMVC for node.js
This is the npm repo npmvc -> short for node-puremvc. I needed a short name because it is the main dependecies for other modules that are build on this module.
###Modification of the [multicore javascript](https://github.com/PureMVC/puremvc-js-multicore-framework/wiki) port for use in a node.js environment.
This is the master repository of the npm ```npmvc``` module.
The main goal of this module is to add more flexibility and modulairity within the use of the combination of Node.js and the PureMVC framework. The module enables the aggregation of classes in a local file structure of PureMVC classes or in seperated modules.
It adds an ```include``` method on top of the official multicore PureMVC JavaScript library (currently version 1.0.1). This method is based on the node.js ```require``` method and is added to the puremvc namespace. (See API specs below).
You can use the ```include``` function to include dependecies that are located local or in other npm modules. Class files are wrapped the node.js module.export style (see Creating external class files).
#install

@@ -35,6 +44,6 @@

// use include te aquire dependencies
// use include te aquire dependency class files
include("controller/StartCommand");
// ---> now just use puremvc.define to define class
// ---> now you can use puremvc.define to define class
/**

@@ -62,3 +71,4 @@ * @class test.ApplicationFacade

/**
* Retrieve an instance of ApplicationFacade. If one has not yet been
* Retrieve an instance of ApplicationFacade.
* If one has not yet been
* instantiated, one will be created for you.

@@ -71,7 +81,3 @@ *

getInstance: function(multitonKey) {
// all Facade instances, including Facade subclass instances, are stored
// on Facade.instanceMap. When implementing you own #getInstance factory
// method, ensure that follow the general pattern implemented here or else
// puremvc.Facade#hasCore and puremvc.Facade#removeCore will not work if
// you ever need to use them.
var instanceMap = puremvc.Facade.instanceMap;

@@ -83,3 +89,3 @@ instance = instanceMap[multitonKey]; // read from the instance map

// otherwise create a new instance and cache it on Facade.instanceMap;
return instanceMap[multitonKey] = new test.ApplicationFacade(multitonKey);

@@ -99,3 +105,3 @@ },

#Extra methods:
This module adds three exra methods to the ```puremvc``` root object:
This module adds some exra methods on top of the ```puremvc``` root object:

@@ -120,3 +126,3 @@ ##puremvc.setSourceDir(path:string):void

Path to puremvc class, relative from path set by **puremvc.setSourceDir**
Path to puremvc class, relative from path set by **puremvc.setSourceDir**

@@ -139,5 +145,4 @@ **tempPath [String]**

----
##puremvc.getSourceDir():string
returns the current sourceDir
returns the current source directory, root of puremvc classes.