npm-root.1 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. .TH "NPM\-ROOT" "1" "October 2021" "" ""
  2. .SH "NAME"
  3. \fBnpm-root\fR \- Display npm root
  4. .SS Synopsis
  5. .P
  6. .RS 2
  7. .nf
  8. npm root [\-g]
  9. .fi
  10. .RE
  11. .SS Description
  12. .P
  13. Print the effective \fBnode_modules\fP folder to standard out\.
  14. .P
  15. Useful for using npm in shell scripts that do things with the
  16. \fBnode_modules\fP folder\. For example:
  17. .P
  18. .RS 2
  19. .nf
  20. #!/bin/bash
  21. global_node_modules="$(npm root \-\-global)"
  22. echo "Global packages installed in: ${global_node_modules}"
  23. .fi
  24. .RE
  25. .SS Configuration
  26. <!\-\- AUTOGENERATED CONFIG DESCRIPTIONS START \-\->
  27. <!\-\- automatically generated, do not edit manually \-\->
  28. <!\-\- see lib/utils/config/definitions\.js \-\->
  29. .SS \fBglobal\fP
  30. .RS 0
  31. .IP \(bu 2
  32. Default: false
  33. .IP \(bu 2
  34. Type: Boolean
  35. .RE
  36. .P
  37. Operates in "global" mode, so that packages are installed into the \fBprefix\fP
  38. folder instead of the current working directory\. See
  39. npm help folders for more on the differences in behavior\.
  40. .RS 0
  41. .IP \(bu 2
  42. packages are installed into the \fB{prefix}/lib/node_modules\fP folder, instead
  43. of the current working directory\.
  44. .IP \(bu 2
  45. bin files are linked to \fB{prefix}/bin\fP
  46. .IP \(bu 2
  47. man pages are linked to \fB{prefix}/share/man\fP
  48. .RE
  49. <!\-\- automatically generated, do not edit manually \-\->
  50. <!\-\- see lib/utils/config/definitions\.js \-\->
  51. <!\-\- AUTOGENERATED CONFIG DESCRIPTIONS END \-\->
  52. .SS See Also
  53. .RS 0
  54. .IP \(bu 2
  55. npm help prefix
  56. .IP \(bu 2
  57. npm help bin
  58. .IP \(bu 2
  59. npm help folders
  60. .IP \(bu 2
  61. npm help config
  62. .IP \(bu 2
  63. npm help npmrc
  64. .RE