web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
914 B

  1. declare namespace pkgUp {
  2. interface Options {
  3. /**
  4. Directory to start from.
  5. @default process.cwd()
  6. */
  7. readonly cwd?: string;
  8. }
  9. }
  10. declare const pkgUp: {
  11. /**
  12. Find the closest `package.json` file.
  13. @returns The filepath, or `null` if it couldn't be found.
  14. @example
  15. ```
  16. // /
  17. // └── Users
  18. // └── sindresorhus
  19. // └── foo
  20. // ├── package.json
  21. // └── bar
  22. // ├── baz
  23. // └── example.js
  24. // example.js
  25. import pkgUp = require('pkg-up');
  26. (async () => {
  27. console.log(await pkgUp());
  28. //=> '/Users/sindresorhus/foo/package.json'
  29. })();
  30. ```
  31. */
  32. (options?: pkgUp.Options): Promise<string | null>;
  33. /**
  34. Synchronously find the closest `package.json` file.
  35. @returns The filepath, or `null` if it couldn't be found.
  36. */
  37. sync(options?: pkgUp.Options): string | null;
  38. };
  39. export = pkgUp;