Commit a2311c3a by Beebuddy Builder

add env

1 parent 8fd71ec8
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "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'`" "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": { "devDependencies": {
"@babel/cli": "7.0.0-rc.1", "@babel/cli": "7.0.0-rc.1",
...@@ -21,5 +20,8 @@ ...@@ -21,5 +20,8 @@
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
"license": "ISC" "license": "ISC",
"dependencies": {
"dotenv": "^8.2.0"
}
} }
...@@ -3,7 +3,11 @@ ...@@ -3,7 +3,11 @@
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true 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"); } } 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+ ...@@ -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; } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
_dotenv.default.config();
var Utils = var Utils =
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
...@@ -28,7 +34,7 @@ function () { ...@@ -28,7 +34,7 @@ function () {
* @returns {String} * @returns {String}
*/ */
value: function printf(str) { value: function printf(str) {
return "=======>".concat(str, "<======="); return "=======>".concat(str, "<=======") + JSON.stringify(process.env);
} }
}]); }]);
...@@ -36,3 +42,7 @@ function () { ...@@ -36,3 +42,7 @@ function () {
}(); }();
exports.Utils = Utils; exports.Utils = Utils;
var ENV = {
env: process.env
};
exports.ENV = ENV;
\ No newline at end of file
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "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'`" "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": { "devDependencies": {
"@babel/cli": "7.0.0-rc.1", "@babel/cli": "7.0.0-rc.1",
...@@ -21,5 +20,8 @@ ...@@ -21,5 +20,8 @@
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
"license": "ISC" "license": "ISC",
"dependencies": {
"dotenv": "^8.2.0"
}
} }
import dotenv from 'dotenv'
dotenv.config();
export class Utils { export class Utils {
/** /**
* @function * @function
...@@ -7,6 +9,12 @@ export class Utils { ...@@ -7,6 +9,12 @@ export class Utils {
* @returns {String} * @returns {String}
*/ */
static printf(str){ 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!