@padhariyavishal/nextpress-config
Version:
Nextpress configuration
34 lines (33 loc) • 1.76 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.dbConfig = exports.rl = void 0;
const readline_1 = __importDefault(require("readline"));
exports.rl = readline_1.default.createInterface({
input: process.stdin,
output: process.stdout,
});
const question = (query) => {
return new Promise((resolve) => exports.rl.question(query, resolve));
};
const dbConfig = () => __awaiter(void 0, void 0, void 0, function* () {
const HOST = yield question("Enter the DB Host: ");
const USER = yield question("Enter the DB Username: ");
const PASSWORD = yield question("Enter the DB Password: ");
const DB = yield question("Enter the DB Name: ");
const username = yield question("Enter the ADMIN Username: ");
const password = yield question("Enter the maximum 8 charcter ADMIN Password: ");
return { HOST, USER, PASSWORD, DB, username, password };
});
exports.dbConfig = dbConfig;