frontend/.pnpm-store/v3/files/d8/f435919cf52060ac85b80c4fa3c0a8c738e9c1f6a800dd14d091fc35fcc9f39cab204e4b0b818d4785e2c7eadc2ffd49fd3b91a4327f5d69660eba3496a9f4

52 lines
1.2 KiB
Plaintext

declare const importCwd: {
/**
Import a module like with [`require()`](https://nodejs.org/api/globals.html#globals_require) but from the current working directory.
@param moduleId - What you would use in `require()`.
@throws Like `require()`, throws when the module can't be found.
@example
```
import importCwd = require('import-cwd');
// Target module is at '/Users/sindresorhus/unicorn/foo.js'
console.log(__dirname);
//=> '/Users/sindresorhus/rainbow'
console.log(process.cwd());
//=> '/Users/sindresorhus/unicorn'
const foo = importCwd('./foo');
```
*/
(moduleId: string): unknown;
/**
Import a module like with [`require()`](https://nodejs.org/api/globals.html#globals_require) but from the current working directory.
@param moduleId - What you would use in `require()`.
@returns `undefined` instead of throwing when the module can't be found.
@example
```
import importCwd = require('import-cwd');
// '/Users/sindresorhus/empty/' is empty
console.log(__dirname);
//=> '/Users/sindresorhus/rainbow'
console.log(process.cwd());
//=> '/Users/sindresorhus/empty'
const foo = importCwd.silent('./nonexistent');
//=> undefined
```
*/
silent(moduleId: string): unknown;
};
export = importCwd;