UNPKG

express-post-task-scheduler

Version:

A lightweight npm package to create and manage scheduled tasks using Express middleware. Configure tasks via POST requests and execute them at specified times seamlessly.

16 lines (15 loc) 398 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.jsonResponse = jsonResponse; /** * Standardize the response format, it should be used with IExtendResponse */ function jsonResponse(req, res, next) { Object.defineProperty(res, "jr", { value: (response) => { res.json(response); }, enumerable: true, }); next(); }