import-sync
Version:
Synchronously import dynamic ECMAScript Modules similar to CommonJS require. Basic wrapper around esm for compatibility with both ESM and CJS projects in NodeJS.
12 lines (11 loc) • 433 B
TypeScript
import { Options } from './options';
/**
* Imports ES6 modules synchronously similar to require in CommonJS
* Can be used in both ES6 and CommonJS projects
*
* @param relativePath - the name or relative path of the module, e.g. ./arrays
* @param {Options} [options] - options as defined in types.ts
* @returns the imported module
*/
declare const importSync: (id: string, options?: Options) => any;
export default importSync;