countries-loader
Advanced tools
Comparing version 1.0.0 to 1.0.3
{ | ||
"name": "countries-loader", | ||
"version": "1.0.0", | ||
"version": "1.0.3", | ||
"description": "load countries, states, cities using cli", | ||
"author": "Khalid Ansari (khalid283)", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
@@ -19,7 +22,8 @@ "start": "tsc && node -r dotenv/config dist/index.js", | ||
}, | ||
"author": "", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/khalid283/countries-loader/issues" | ||
}, | ||
"bin": { | ||
"countries-loader": "./dist/index.js" | ||
}, | ||
"homepage": "https://github.com/khalid283/countries-loader#readme", | ||
@@ -26,0 +30,0 @@ "dependencies": { |
@@ -1,7 +0,14 @@ | ||
import mysql, { Connection } from "mysql2"; | ||
import { config } from "../config/config"; | ||
import * as mysql from "mysql2"; | ||
import { Connection } from "mysql2"; | ||
export const getConnection = async (): Promise<Connection> => { | ||
return new Promise((resolve) => { | ||
const connection = mysql.createConnection(config); | ||
const connection = mysql.createConnection({ | ||
host: process.env.DB_HOST, | ||
user: process.env.DB_USERNAME, | ||
password: process.env.DB_PASSWORD, | ||
database: process.env.DB_DATABASE, | ||
port: Number(process.env.DB_PORT) || 3306, | ||
charset: process.env.DB_CHARSET, | ||
}); | ||
connection.connect((err) => { | ||
@@ -8,0 +15,0 @@ if (err) { |
@@ -0,1 +1,2 @@ | ||
#! /usr/bin/env node | ||
import * as clear from "clear"; | ||
@@ -7,7 +8,8 @@ import * as figlet from "figlet"; | ||
const ascii = chalk.default.bold.blueBright; | ||
const blue = chalk.default.bold.blue; | ||
const red = chalk.default.bold.red; | ||
require("dotenv").config(); | ||
const ascii = chalk.bold.blueBright; | ||
const blue = chalk.bold.blue; | ||
const red = chalk.bold.red; | ||
clear.default(); | ||
clear(); | ||
@@ -34,2 +36,5 @@ console.log(ascii(figlet.textSync("Country Loader", { horizontalLayout: "full" }))); | ||
program.option("-s, --states", "load states"); | ||
program.option("-ci, --cities", "load cities"); | ||
program.parse(process.argv); |
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"esModuleInterop": true, | ||
"target": "es6", | ||
@@ -6,0 +5,0 @@ "moduleResolution": "node", |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
25738
29
651
0
1
31