t-comm
Version:
专业、稳定、纯粹的工具库
18 lines (16 loc) • 367 B
JavaScript
/**
* 获取 http 模块
* @returns http 模块
* @description 仅在 Node.js 环境中可用
* @example
* ```ts
* import { getHttp } from 't-comm';
* const http = getHttp();
* http.request(options, callback);
* ```
*/
function getHttp() {
// eslint-disable-next-line @typescript-eslint/no-require-imports
return require('http');
}
export { getHttp };