Commit a2311c3a by Beebuddy Builder

add env

1 parent 8fd71ec8
......@@ -6,7 +6,6 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "babel index.js -D -d dist && babel src -D -d dist/src && babel ./.babelrc -D -d dist && babel ./package.json -D -d dist && echo '\n🍺 'Build success at `date '+%T %F'`"
},
"devDependencies": {
"@babel/cli": "7.0.0-rc.1",
......@@ -21,5 +20,8 @@
},
"keywords": [],
"author": "",
"license": "ISC"
"license": "ISC",
"dependencies": {
"dotenv": "^8.2.0"
}
}
......@@ -3,7 +3,11 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Utils = void 0;
exports.ENV = exports.Utils = void 0;
var _dotenv = _interopRequireDefault(require("dotenv"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
......@@ -11,6 +15,8 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
_dotenv.default.config();
var Utils =
/*#__PURE__*/
function () {
......@@ -28,11 +34,15 @@ function () {
* @returns {String}
*/
value: function printf(str) {
return "=======>".concat(str, "<=======");
return "=======>".concat(str, "<=======") + JSON.stringify(process.env);
}
}]);
return Utils;
}();
exports.Utils = Utils;
\ No newline at end of file
exports.Utils = Utils;
var ENV = {
env: process.env
};
exports.ENV = ENV;
\ No newline at end of file
......@@ -6,7 +6,6 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "babel index.js -D -d dist && babel src -D -d dist/src && babel ./.babelrc -D -d dist && babel ./package.json -D -d dist && echo '\n🍺 'Build success at `date '+%T %F'`"
},
"devDependencies": {
"@babel/cli": "7.0.0-rc.1",
......@@ -21,5 +20,8 @@
},
"keywords": [],
"author": "",
"license": "ISC"
"license": "ISC",
"dependencies": {
"dotenv": "^8.2.0"
}
}
import dotenv from 'dotenv'
dotenv.config();
export class Utils {
/**
* @function
......@@ -7,6 +9,12 @@ export class Utils {
* @returns {String}
*/
static printf(str){
return `=======>${str}<=======`;
return `=======>${str}<=======` + JSON.stringify( process.env );
}
}
export const ENV = {
env : process.env
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!