npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

debug-tool-express

v1.1.4

Published

A utility for debugging node.JS express web applications.

Downloads

10

Readme

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.

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"

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 Option | Debug Message Outputs ---------------------|------------------------------------ true | Outputs all debug messages. debug | Outputs all debug messages. info | Outputs the info, and error debug messages. error | Outputs 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.