Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
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.

105 lines
2.8 KiB

  1. .TH "NPM\-LINK" "1" "August 2018" "" ""
  2. .SH "NAME"
  3. \fBnpm-link\fR \- Symlink a package folder
  4. .SH SYNOPSIS
  5. .P
  6. .RS 2
  7. .nf
  8. npm link (in package dir)
  9. npm link [<@scope>/]<pkg>[@<version>]
  10. alias: npm ln
  11. .fi
  12. .RE
  13. .SH DESCRIPTION
  14. .P
  15. Package linking is a two\-step process\.
  16. .P
  17. First, \fBnpm link\fP in a package folder will create a symlink in the global folder
  18. \fB{prefix}/lib/node_modules/<package>\fP that links to the package where the \fBnpm
  19. link\fP command was executed\. (see npm help 7 \fBnpm\-config\fP for the value of \fBprefix\fP)\. It
  20. will also link any bins in the package to \fB{prefix}/bin/{name}\fP\|\.
  21. .P
  22. Next, in some other location, \fBnpm link package\-name\fP will create a
  23. symbolic link from globally\-installed \fBpackage\-name\fP to \fBnode_modules/\fP
  24. of the current folder\.
  25. .P
  26. Note that \fBpackage\-name\fP is taken from \fBpackage\.json\fP,
  27. not from directory name\.
  28. .P
  29. The package name can be optionally prefixed with a scope\. See npm help 7 \fBnpm\-scope\fP\|\.
  30. The scope must be preceded by an @\-symbol and followed by a slash\.
  31. .P
  32. When creating tarballs for \fBnpm publish\fP, the linked packages are
  33. "snapshotted" to their current state by resolving the symbolic links\.
  34. .P
  35. This is handy for installing your own stuff, so that you can work on it and
  36. test it iteratively without having to continually rebuild\.
  37. .P
  38. For example:
  39. .P
  40. .RS 2
  41. .nf
  42. cd ~/projects/node\-redis # go into the package directory
  43. npm link # creates global link
  44. cd ~/projects/node\-bloggy # go into some other package directory\.
  45. npm link redis # link\-install the package
  46. .fi
  47. .RE
  48. .P
  49. Now, any changes to ~/projects/node\-redis will be reflected in
  50. ~/projects/node\-bloggy/node_modules/node\-redis/\. Note that the link should
  51. be to the package name, not the directory name for that package\.
  52. .P
  53. You may also shortcut the two steps in one\. For example, to do the
  54. above use\-case in a shorter way:
  55. .P
  56. .RS 2
  57. .nf
  58. cd ~/projects/node\-bloggy # go into the dir of your main project
  59. npm link \.\./node\-redis # link the dir of your dependency
  60. .fi
  61. .RE
  62. .P
  63. The second line is the equivalent of doing:
  64. .P
  65. .RS 2
  66. .nf
  67. (cd \.\./node\-redis; npm link)
  68. npm link redis
  69. .fi
  70. .RE
  71. .P
  72. That is, it first creates a global link, and then links the global
  73. installation target into your project's \fBnode_modules\fP folder\.
  74. .P
  75. Note that in this case, you are referring to the directory name, \fBnode\-redis\fP,
  76. rather than the package name \fBredis\fP\|\.
  77. .P
  78. If your linked package is scoped (see npm help 7 \fBnpm\-scope\fP) your link command must
  79. include that scope, e\.g\.
  80. .P
  81. .RS 2
  82. .nf
  83. npm link @myorg/privatepackage
  84. .fi
  85. .RE
  86. .SH SEE ALSO
  87. .RS 0
  88. .IP \(bu 2
  89. npm help 7 developers
  90. .IP \(bu 2
  91. npm help 5 package\.json
  92. .IP \(bu 2
  93. npm help install
  94. .IP \(bu 2
  95. npm help 5 folders
  96. .IP \(bu 2
  97. npm help config
  98. .IP \(bu 2
  99. npm help 7 config
  100. .IP \(bu 2
  101. npm help 5 npmrc
  102. .RE