dbcreator

1.0.1 • Public • Published

dbCreator

npm package that allows users to create a database connection

features

Use inquirer prompt to give value to the following variables:

  • host
  • port
  • password
  • database

dependencies

  • mysql
  • inquirer
  • fs

boilerplate provided

// Initializes the connection variable to sync with a MySQL database
var connection = mysql.createConnection({
  host: "",
  port: ,

  // Your username
  user: "",

  // Your password
  password: "",
  database: ""
});

// Creates the connection with the server and loads the product data upon a successful connection
connection.connect(function(err) {
  if (err) {
    console.error("error connecting: " + err.stack);
  }
    console.log('connection succesful and database created")
});

Readme

Keywords

none

Package Sidebar

Install

npm i dbcreator

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

1.47 kB

Total Files

3

Last publish

Collaborators

  • iamdio