util4js

The util4js library contains JavaScript utilities.

util4js

The util4js library contains JavaScript utilities.

npm install util4js

Exception class is the base class for all exceptions.

Example

"use strict";

require("class4js");
var util4js = require("../lib/util4js.js");

var CustomException = $class({
  __construct__: function () {
    this.name = "CustomException"; 
  }
}, util4js.Exception);

try {
  throw new CustomException("Exception was raised");
} catch (ex) {
  console.log(ex.name + ": " + ex.message);
}

This software is distributed under the terms of the GNU General Public License, version 3 (GPL-3.0).