- Node.js (latest version)
- npm (comes with Node.js)
-
Clone the project from GitHub:
git clone <URL of the project> cd <project directory name>
-
Install dependencies:
npm install
index.js
: The main file containing your source code.package.json
: npm configuration file containing information about dependencies.
This project uses PGlite
to manage the database. Data will be stored in the directory D:/Weminal/data
.
-
Initialize the database and run the examples:
node index.js
The
index.js
file will perform the following operations:- Initialize the database and create the
UserTest
table if it does not exist. - Add a new user.
- Retrieve user information by ID.
- Update user information.
- List all tables in the database.
- Retrieve all users from the
UserTest
table.
- Initialize the database and create the
Below is the source code of the index.js
file: