employee-tracker
v1.0.3
Published
Program that allows user to view, add, and update employee data into an organized database from command line prompts.
Downloads
10
Maintainers
Readme
Employee Tracker
Description
Program that allows user to view, add, and update employee data into an organized database from command line prompts. User can access and manipulate database within their own project using lowdb functionality.
Uses lowdb, inquirer and chalk.
Install
npm install employee-tracker
Usage
Run command-line interface.
npm explore employee-tracker -- npm start
Access database using lowdb.
const low = require('lowdb');
const FileSync = require('lowdb/adapters/FileSync');
const adapter = new FileSync('db/employee_db.json');
const db = low(adapter);
// Return a list of employee objects
db.get('employees')
.value();
// Return the role with an id of 2
db.get('roles')
.find({ id: 2 })
.value();
Not recommended to write to database using lowdb functions because of id incrementing.