|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.0 KB
|
| Line | |
|---|
| 1 | declare const resolveFrom: {
|
|---|
| 2 | /**
|
|---|
| 3 | Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path.
|
|---|
| 4 |
|
|---|
| 5 | @param fromDirectory - Directory to resolve from.
|
|---|
| 6 | @param moduleId - What you would use in `require()`.
|
|---|
| 7 | @returns Resolved module path. Throws when the module can't be found.
|
|---|
| 8 |
|
|---|
| 9 | @example
|
|---|
| 10 | ```
|
|---|
| 11 | import resolveFrom = require('resolve-from');
|
|---|
| 12 |
|
|---|
| 13 | // There is a file at `./foo/bar.js`
|
|---|
| 14 |
|
|---|
| 15 | resolveFrom('foo', './bar');
|
|---|
| 16 | //=> '/Users/sindresorhus/dev/test/foo/bar.js'
|
|---|
| 17 | ```
|
|---|
| 18 | */
|
|---|
| 19 | (fromDirectory: string, moduleId: string): string;
|
|---|
| 20 |
|
|---|
| 21 | /**
|
|---|
| 22 | Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path.
|
|---|
| 23 |
|
|---|
| 24 | @param fromDirectory - Directory to resolve from.
|
|---|
| 25 | @param moduleId - What you would use in `require()`.
|
|---|
| 26 | @returns Resolved module path or `undefined` when the module can't be found.
|
|---|
| 27 | */
|
|---|
| 28 | silent(fromDirectory: string, moduleId: string): string | undefined;
|
|---|
| 29 | };
|
|---|
| 30 |
|
|---|
| 31 | export = resolveFrom;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.