Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

index.d.ts 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /// <reference types="node"/>
  2. import {ListenOptions} from 'net';
  3. declare namespace getPort {
  4. interface Options extends Omit<ListenOptions, 'port'> {
  5. /**
  6. A preferred port or an iterable of preferred ports to use.
  7. */
  8. readonly port?: number | Iterable<number>;
  9. /**
  10. The host on which port resolution should be performed. Can be either an IPv4 or IPv6 address.
  11. */
  12. readonly host?: string;
  13. }
  14. }
  15. declare const getPort: {
  16. /**
  17. Get an available TCP port number.
  18. @returns Port number.
  19. @example
  20. ```
  21. import getPort = require('get-port');
  22. (async () => {
  23. console.log(await getPort());
  24. //=> 51402
  25. // Pass in a preferred port
  26. console.log(await getPort({port: 3000}));
  27. // Will use 3000 if available, otherwise fall back to a random port
  28. // Pass in an array of preferred ports
  29. console.log(await getPort({port: [3000, 3001, 3002]}));
  30. // Will use any element in the preferred ports array if available, otherwise fall back to a random port
  31. })();
  32. ```
  33. */
  34. (options?: getPort.Options): Promise<number>;
  35. /**
  36. Make a range of ports `from`...`to`.
  37. @param from - First port of the range. Must be in the range `1024`...`65535`.
  38. @param to - Last port of the range. Must be in the range `1024`...`65535` and must be greater than `from`.
  39. @returns The ports in the range.
  40. @example
  41. ```
  42. import getPort = require('get-port');
  43. (async () => {
  44. console.log(await getPort({port: getPort.makeRange(3000, 3100)}));
  45. // Will use any port from 3000 to 3100, otherwise fall back to a random port
  46. })();
  47. ```
  48. */
  49. makeRange(from: number, to: number): Iterable<number>;
  50. };
  51. export = getPort;