UNPKG

984 BTypeScriptView Raw
1// Type definitions for require-from-string 1.2
2// Project: https://github.com/floatdrop/require-from-string
3// Definitions by: Ika <https://github.com/ikatyang>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6/**
7 * Load module from string in Node.
8 */
9declare function requireFromString(code: string, options?: requireFromString.Options): any;
10declare function requireFromString(code: string, filename?: string, options?: requireFromString.Options): any;
11
12declare namespace requireFromString {
13 interface Options {
14 /**
15 * List of `paths`, that will be appended to module `paths`.
16 * Useful when you want to be able require modules from these paths.
17 */
18 appendPaths?: string[];
19 /**
20 * List of `paths`, that will be preppended to module `paths`.
21 * Useful when you want to be able require modules from these paths.
22 */
23 prependPaths?: string[];
24 }
25}
26
27export = requireFromString;