v2 initial slow track

This commit is contained in:
Jiiks 2016-10-31 17:36:03 +02:00
parent 28ad0c0acc
commit c5454a8f57
6 changed files with 123 additions and 0 deletions

1
v2/README.MD Normal file
View File

@ -0,0 +1 @@
v2 preview for external testers

8
v2/lib/config.json Normal file
View File

@ -0,0 +1,8 @@
{
"core": {
"version": "0.3.0"
},
"Core": {
"Version": "0.3.0"
}
}

38
v2/lib/core.js Normal file
View File

@ -0,0 +1,38 @@
/* BetterDiscordApp Core
* Version: 2:1.0
* Author: Jiiks | https://jiiks.net
* Date: 31/10/2016
* Last Update: 31/10/2016
* Github: https://github.com/Jiiks/BetterDiscordApp
* Git: https://github.com/Jiiks/BetterDiscordApp.git
* License: MIT
*/
'use strict';
const
_fs = require('fs'),
_config = require('./config.json'),
{_utils} = require('./utils'),
{_logger} = require('./utils'),
{EOL} = require('os');
const _startDate = new Date();
var _cfg;
const _defaults = {};
class Core {
constructor(args) {
}
initConfig(args) {
}
}
exports.BetterDiscord = new Core(null);

1
v2/lib/main.js Normal file
View File

@ -0,0 +1 @@
module.exports = require('./core');

65
v2/lib/utils.js Normal file
View File

@ -0,0 +1,65 @@
/* BetterDiscordApp Utilities
* Version: 2:1.0
* Author: Jiiks | https://jiiks.net
* Date: 31/10/2016
* Last Update: 31/10/2016
* Github: https://github.com/Jiiks/BetterDiscordApp
* Git: https://github.com/Jiiks/BetterDiscordApp.git
* License: MIT
*/
'use strict';
class Utils {
//Returns a datestring: [DD/MM/YYYY - HH:MM:SS]
get dateString() {
var d = new Date();
return `${("00" + (d.getDate() + 1)).slice(-2)}/` +
`${("00" + d.getMonth()).slice(-2)}/` +
`${d.getFullYear()} - ` +
`${("00" + d.getHours()).slice(-2)}:` +
`${("00" + d.getMinutes()).slice(-2)}:` +
`${("00" + d.getSeconds()).slice(-2)}`;
}
}
class Logger {
constructor() {
this.logs = "";
}
log(msg, severity) {
var l = `{BD|${this.severity(severity)}}[${_utils.dateString}] >>> ${msg}`;
console.log(l);
this.logs += `${l}${EOL}`;
}
save() {
try {
_fs.writeFileSync('logs.log', this.logs);
}catch(err) {
this.log("Failed to save logs! " + err, 2);
}
}
severity(severity) {
return {
0: "INF",
1: "WRN",
2: "ERR"
}[severity||0];
}
}
const _utils = new Utils(),
_logger = new Logger(),
_fs = require('fs'),
{EOL} = require('os');
exports._utils = _utils;
exports._logger = _logger;

10
v2/package.json Normal file
View File

@ -0,0 +1,10 @@
{
"name": "betterdiscord",
"description": "Discord enhancement project. v2 preview",
"version": "0.3.0",
"homepage": "https://github.com/Jiiks/BetterDiscordApp",
"license": "MIT",
"main": "lib/main.js",
"devDependencies": {
}
}