Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

cpm-utils

cpmangukiya6ISC1.0.6

Utility functions for easy development

utils, utility, nodejs, handy, developer

readme

cpm-utils

This is a utility package for NodeJS Apps

Usage

Install the package using npm :

 npm install cpm-utils --save

Then, require the package and use it:

 var cpmUtils = require('cpm-utils');
 console.log(cpmUtils.isEmpty("")); // true [Sample]
 console.log(cpmUtils.isEmpty("Hello World")); // false [Sample]
 console.log(cpmUtils.isEmpty({})); // true [Sample]
 console.log(cpmUtils.isEmpty({ "hello" : "world" })); // false [Sample]

Tiny express app is configured to call a middleware function of your own on "/doSomething" GET method. Express Exception handling can be done by calling next(err) appropriately :

 var cpmUtils = require('cpm-utils');
 cpmUtils.launchExpressServer(function (req, res, next) {
    // Do your stuff
    res.send("My Function Called!");
 });
 // And then hit http://localhost:3000/doSomething to execute your code.
 // Healthcheck URL : http://localhost:3000/healthcheck