1.0.6 • Published 5 years ago

cpm-utils v1.0.6

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

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
1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago