1.0.3 • Published 5 years ago
employee-tracker v1.0.3
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-trackerUsage
Run command-line interface.
npm explore employee-tracker -- npm startAccess 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.