index.d.ts 949 B

12345678910111213141516171819202122232425262728293031323334
  1. declare const registryUrl: {
  2. /**
  3. Get the set npm registry URL.
  4. @param scope - Retrieve the registry URL associated with an [npm scope](https://docs.npmjs.com/misc/scope). If the provided scope is not in the user's `.npmrc` file, then `registry-url` will check for the existence of `registry`, or if that's not set, fallback to the default npm registry.
  5. @example
  6. ```
  7. import registryUrl = require('registry-url');
  8. // # .npmrc
  9. // registry = 'https://custom-registry.com/'
  10. console.log(registryUrl());
  11. //=> 'https://custom-registry.com/'
  12. // # .npmrc
  13. // @myco:registry = 'https://custom-registry.com/'
  14. console.log(registryUrl('@myco'));
  15. //=> 'https://custom-registry.com/'
  16. ```
  17. */
  18. (scope?: string): string;
  19. // TODO: Remove this for the next major release, refactor the whole definition to:
  20. // declare function registryUrl(scope?: string): string;
  21. // export = registryUrl;
  22. default: typeof registryUrl;
  23. };
  24. export = registryUrl;