index.d.ts 780 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. Check if your code is running as an [npm](https://docs.npmjs.com/misc/scripts) or [yarn](https://yarnpkg.com/lang/en/docs/cli/run/) script.
  3. @example
  4. ```
  5. import {isNpmOrYarn} from 'is-npm';
  6. if (isNpmOrYarn) {
  7. console.log('Running as an npm or yarn script!');
  8. }
  9. ```
  10. */
  11. export const isNpmOrYarn: boolean;
  12. /**
  13. Check if your code is running as an [npm](https://docs.npmjs.com/misc/scripts) script.
  14. @example
  15. ```
  16. import {isNpm} from 'is-npm';
  17. if (isNpm) {
  18. console.log('Running as an npm script!');
  19. }
  20. ```
  21. */
  22. export const isNpm: boolean;
  23. /**
  24. Check if your code is running as a [yarn](https://yarnpkg.com/lang/en/docs/cli/run/) script.
  25. @example
  26. ```
  27. import {isYarn} from 'is-npm';
  28. if (isYarn) {
  29. console.log('Running as a yarn script!');
  30. }
  31. ```
  32. */
  33. export const isYarn: boolean;