var moment = require("moment-timezone"); var momentDurationFormatSetup = require("moment-duration-format"); momentDurationFormatSetup(moment); typeof moment.duration.fn.format === "function"; // true typeof moment.duration.format === "function"; // true