2021-03-23 09:11:41 +00:00
|
|
|
import path from 'path';
|
|
|
|
|
2020-11-21 15:41:08 +00:00
|
|
|
export { ScopedEventEmitter } from './events';
|
|
|
|
export { IProcessData, spawnProcess, execProcess } from './run';
|
2021-03-23 09:11:41 +00:00
|
|
|
|
2021-10-02 08:07:01 +00:00
|
|
|
/**
|
|
|
|
* Load a Node.js module without caching it.
|
|
|
|
* @param file JavaScript file
|
|
|
|
* @returns Loaded module
|
|
|
|
*/
|
2021-03-23 09:11:41 +00:00
|
|
|
export function requireNoCache(file: string): object | undefined {
|
|
|
|
const fullPath = path.resolve(file);
|
|
|
|
const mod = require(fullPath);
|
|
|
|
if (require.cache && require.cache[fullPath]) {
|
|
|
|
delete require.cache[fullPath];
|
|
|
|
}
|
|
|
|
return mod;
|
|
|
|
}
|