New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

debug-tool-express

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

debug-tool-express

A utility for debugging node.JS express web applications.

latest
npmnpm
Version
1.1.4
Version published
Weekly downloads
4
300%
Maintainers
1
Weekly downloads
 
Created
Source

Node and Express Utility Tool - Version 1.1.3

## Codeship Status for DPCobb/Debug-Tool This utility is for node and express. It formats the console output for easy readability and provides a node package.json version incrementor.



# Installation

Install by running npm install debug-tool-express --save-dev. You will then need to require it into your project.

Dependencies

"chalk": "^1.1.3",
"dotenv": "^4.0.0"


#Using The Debugger

Adding Debug Messages.

To add a debug message to your code pass the .debug method an object. The following values can be defined but all are optional. There are three message levels. They are ERROR, INFO and DEBUG.

{
  logMsg = ''
  method = ''
  url = ''
  ip = ''
  level = 'Selected one of the levels above.'
}

Activating Console Messages.

The debugging logger messages for this application have 3 levels. They are error, info, and debug.

Set the DEBUG=opt to one of the opt below. This will output specific level messages to the console.

Debug OptionDebug Message Outputs
trueOutputs all debug messages.
debugOutputs all debug messages.
infoOutputs the info, and error debug messages.
errorOutputs the error debug messages.


# Version Updater

The version updater has two different methods: updateManual and updateAuto. The class is exported as update.

updateManual(ver, rel)

This method takes two parameters: the current version and the type of release. The available release types are major, minor, and patch. The updateManual method will just return the value for the new current version based on your inputs. The following examples assume you have required the file with the variable v:

For Manual updates:
v.update.updateManual('1.0.1', major) returns: 2.0.0
v.update.updateManual('1.0.1', minor) returns: 1.1.1
v.update.updateManual('1.0.1', patch) returns: 1.0.2

updateAuto(rel)

This method accepts on parameter for the release type: major, minor, or patch. This method will pull the current release number from the package.json file and make the appropriate changes to the version based on the release parameter given. The following examples assume you have required the file with the variable v:

For Auto updates:
v.update.updateAuto('major') automatically updates the major release in package.json and resets minor and patch to zero
v.update.updateAuto('minor') automatically updates the minor release in package.json
v.update.updateAuto('patch') automatically updates the patch release in package.json

updateAuto will also return a status of 'package.json updated'.

Workflow

Using Feature Branches

When adding features to the URL Shorter the feature branch workflow should be used. This means the following steps should be taken.

  • git checkout master - Switch to the master branch.
  • git pull - Pull any updates.
  • git branch <feature-name> - Create a new feature.branch replacing <feature-name> with the feature name.
  • git checkout <feature-name> - Switch to that branches name.
  • Work on your code and push to the feature branch.
  • git checkout master - When done switch to the master branch.
  • git pull - Pull any updates from the master
  • git checkout <feature-name - Switch back to the feature branch.
  • git merge master - Merge any changes from the master.
  • Commit and push any changes if necessary.
  • Create a pull request for your feature into the master branch. Codeship must get a green build before this is allowed.

##Unit Testing To unit test the debugger run `mocha` in the packages main directory.

# Code Styling ## AirBnb JavaScript This projected follows the AirBnb Javascript styling conventions. Their documentation can be found at [https://github.com/airbnb/javascript](https://github.com/airbnb/javascript "AirBnb JavaScript Style Guide").

FAQs

Package last updated on 25 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts