0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-03-25 02:32:52 -05:00
verdaccio/src/api/debug/index.ts
renovate[bot] 23d0bd7056
fix(deps): update all non-major linting dependencies (5.x) ()
* fix(deps): update all non-major linting dependencies

* fix lint issues

* chore: increase timeout

* chore: increase timeout

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Juan Picado <juanpicado19@gmail.com>
2022-01-09 20:31:26 +01:00

26 lines
698 B
TypeScript

import { $ResponseExtend, $RequestExtend, $NextFunctionVer } from '../../../types';
import _ from 'lodash';
import { Application } from 'express';
export default (app: Application, selfPath: string): void => {
// Hook for tests only
app.get(
'/-/_debug',
function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {
const doGarbabeCollector = _.isNil(global.gc) === false;
if (doGarbabeCollector) {
global.gc();
}
next({
pid: process.pid,
// @ts-ignore
main: process.mainModule.filename,
conf: selfPath,
mem: process.memoryUsage(),
gc: doGarbabeCollector
});
}
);
};