1.0.3 • Published 3 years ago

employee-tracker v1.0.3

Weekly downloads
53
License
MIT
Repository
github
Last release
3 years ago

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.

Tutorial Video