+26
-14
@@ -110,5 +110,13 @@ var path = require('path'); | ||
| setTimeout(function () { | ||
| isWait = false; | ||
| manageWorkers(); | ||
| if (filename && filename.indexOf('build.json')) { | ||
| loadConfig(build); | ||
| assetWatcher(build.js, 'js'); // Monitor JS files changes | ||
| assetWatcher(build.css, 'css'); // Monitor CSS files changes | ||
| } | ||
| }, 500) | ||
@@ -156,2 +164,19 @@ } | ||
| var loadConfig = function (config) { | ||
| if (typeof config != 'object') { | ||
| config = {}; | ||
| } | ||
| basePath = config.basePath || path.dirname(require.main.filename); | ||
| build = require(path.join(basePath, 'build.json')); | ||
| for (var val in config) { | ||
| build[val] = config[val]; | ||
| } | ||
| if (typeof build != 'object') { | ||
| throw new Error('[MANAGER]'.magenta + ' Cant load configuration from build.json'.red); | ||
| } | ||
| } | ||
| //Public methods | ||
@@ -216,17 +241,4 @@ module.exports.on = function (event, cb) { | ||
| if (typeof config != 'object') { | ||
| config = {}; | ||
| } | ||
| loadConfig(config); | ||
| basePath = config.basePath || path.dirname(require.main.filename); | ||
| build = require(path.join(basePath, 'build.json')); | ||
| for (var val in config) { | ||
| build[val] = config[val]; | ||
| } | ||
| if (typeof build != 'object') { | ||
| throw new Error('[MANAGER]'.magenta + ' Cant load configuration from build.json'.red); | ||
| } | ||
| if (cluster.isMaster) { | ||
@@ -233,0 +245,0 @@ manageWorkers(); |
+43
-23
| { | ||
| "name": "manager", | ||
| "description": "Node.JS app lifecycle manager", | ||
| "keywords": ["production", "development", "deployment", "javascript", "css", "minify", "build"], | ||
| "version": "1.0.7", | ||
| "main": "index", | ||
| "homepage": "https://github.com/konteck/manager", | ||
| "engines": { "node": ">=0.6.0" }, | ||
| "author": { | ||
| "name": "Alex Movsisyan", | ||
| "url": "https://github.com/konteck/manager" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/konteck/manager" | ||
| }, | ||
| "dependencies": { | ||
| "uglify-js": "1.2.x", | ||
| "uglifycss": "0.0.x" | ||
| }, | ||
| "licenses" : [{ | ||
| "type" : "MIT", | ||
| "url" : "https://raw.github.com/konteck/manager/master/LICENSE.txt" | ||
| }] | ||
| "name": "manager", | ||
| "description": "Node.JS app lifecycle manager", | ||
| "keywords": [ | ||
| "production", | ||
| "development", | ||
| "deployment", | ||
| "javascript", | ||
| "css", | ||
| "minify", | ||
| "build" | ||
| ], | ||
| "version": "1.0.8", | ||
| "main": "index", | ||
| "homepage": "https://github.com/konteck/manager", | ||
| "engines": { | ||
| "node": ">=0.6.0" | ||
| }, | ||
| "author": { | ||
| "name": "Alex Movsisyan", | ||
| "url": "https://github.com/konteck/manager" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git://github.com/konteck/manager.git" | ||
| }, | ||
| "dependencies": { | ||
| "uglify-js": "1.2.x", | ||
| "uglifycss": "0.0.x" | ||
| }, | ||
| "licenses": [ | ||
| { | ||
| "type": "MIT", | ||
| "url": "https://raw.github.com/konteck/manager/master/LICENSE.txt" | ||
| } | ||
| ], | ||
| "_id": "manager@1.0.7", | ||
| "devDependencies": {}, | ||
| "optionalDependencies": {}, | ||
| "_engineSupported": true, | ||
| "_npmVersion": "1.1.4", | ||
| "_nodeVersion": "v0.6.12", | ||
| "_defaultsLoaded": true, | ||
| "_from": "manager@1.0.x" | ||
| } |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
12495
5.12%256
3.23%