require() like so:
const sqlite3 = require('sqlite3');
sqlite3 that we can interact with via methods. The first method we’re going to use on
sqlite3 is going to be the method that opens up a new database. In SQLite, a database corresponds to a single file, so the only argument required to open this database is the path to the file that SQLite will use to save the database.
const db = new sqlite3.Database('./db.sqlite');
This code will create a new database file, in the current folder, named
db.sqlite. Then we’ll have a database to interact with!
sqlite3 package and save it in a
Open the database by invoking a
sqlite3.Database and providing the path to your database file (
db.sqlite). Assign this to the variable