mirror of
https://gitlab.com/Shinobi-Systems/ShinobiCE.git
synced 2025-03-09 15:40:15 +00:00
Blue Turtle - The Refactoring
This commit is contained in:
parent
04011678fb
commit
b7d08eb500
67 changed files with 11651 additions and 8452 deletions
33
libs/process.js
Normal file
33
libs/process.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
var os = require('os')
|
||||
module.exports = function(process,__dirname){
|
||||
process.send = process.send || function () {};
|
||||
process.on('uncaughtException', function (err) {
|
||||
console.error('Uncaught Exception occured!');
|
||||
console.error(err.stack);
|
||||
});
|
||||
// [CTRL] + [C] = exit
|
||||
process.on('SIGINT', function() {
|
||||
console.log('Shinobi is Exiting...')
|
||||
process.exit();
|
||||
});
|
||||
// s = Shinobi
|
||||
s = {
|
||||
//Total Memory
|
||||
coreCount : os.cpus().length,
|
||||
//Total Memory
|
||||
totalmem : os.totalmem(),
|
||||
//Check Platform
|
||||
platform : os.platform(),
|
||||
//JSON stringify short-hand
|
||||
s : JSON.stringify,
|
||||
//Pretty Print JSON
|
||||
prettyPrint : function(obj){return JSON.stringify(obj,null,3)},
|
||||
//Check if Windows
|
||||
isWin : (process.platform === 'win32' || process.platform === 'win64'),
|
||||
//UTC Offset
|
||||
utcOffset : require('moment')().utcOffset(),
|
||||
//directory path for this file
|
||||
mainDirectory : __dirname
|
||||
}
|
||||
return s
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue