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.

175 lines
6.7 KiB

  1. .TH "NPX" "1" "April 2018" "npx@10.1.1" "User Commands"
  2. .SH "NAME"
  3. \fBnpx\fR \- execute npm package binaries
  4. .SH SYNOPSIS
  5. .P
  6. \fBnpx [options] <command>[@version] [command\-arg]\.\.\.\fP
  7. .P
  8. \fBnpx [options] [\-p|\-\-package <pkg>]\.\.\. <command> [command\-arg]\.\.\.\fP
  9. .P
  10. \fBnpx [options] \-c '<command\-string>'\fP
  11. .P
  12. \fBnpx \-\-shell\-auto\-fallback [shell]\fP
  13. .SH INSTALL
  14. .P
  15. \fBnpm install \-g npx\fP
  16. .SH DESCRIPTION
  17. .P
  18. Executes \fB<command>\fP either from a local \fBnode_modules/\.bin\fP, or from a central cache, installing any packages needed in order for \fB<command>\fP to run\.
  19. .P
  20. By default, \fBnpx\fP will check whether \fB<command>\fP exists in \fB$PATH\fP, or in the local project binaries, and execute that\. If \fB<command>\fP is not found, it will be installed prior to execution\.
  21. .P
  22. Unless a \fB\-\-package\fP option is specified, \fBnpx\fP will try to guess the name of the binary to invoke depending on the specifier provided\. All package specifiers understood by \fBnpm\fP may be used with \fBnpx\fP, including git specifiers, remote tarballs, local directories, or scoped packages\.
  23. .P
  24. If a full specifier is included, or if \fB\-\-package\fP is used, npx will always use a freshly\-installed, temporary version of the package\. This can also be forced with the \fB\-\-ignore\-existing\fP flag\.
  25. .RS 0
  26. .IP \(bu 2
  27. \fB\-p, \-\-package <package>\fP \- define the package to be installed\. This defaults to the value of \fB<command>\fP\|\. This is only needed for packages with multiple binaries if you want to call one of the other executables, or where the binary name does not match the package name\. If this option is provided \fB<command>\fP will be executed as\-is, without interpreting \fB@version\fP if it's there\. Multiple \fB\-\-package\fP options may be provided, and all the packages specified will be installed\.
  28. .IP \(bu 2
  29. \fB\-\-no\-install\fP \- If passed to \fBnpx\fP, it will only try to run \fB<command>\fP if it already exists in the current path or in \fB$prefix/node_modules/\.bin\fP\|\. It won't try to install missing commands\.
  30. .IP \(bu 2
  31. \fB\-\-cache <path>\fP \- set the location of the npm cache\. Defaults to npm's own cache settings\.
  32. .IP \(bu 2
  33. \fB\-\-userconfig <path>\fP \- path to the user configuration file to pass to npm\. Defaults to whatever npm's current default is\.
  34. .IP \(bu 2
  35. \fB\-c <string>\fP \- Execute \fB<string>\fP inside an \fBnpm run\-script\fP\-like shell environment, with all the usual environment variables available\. Only the first item in \fB<string>\fP will be automatically used as \fB<command>\fP\|\. Any others \fImust\fR use \fB\-p\fP\|\.
  36. .IP \(bu 2
  37. \fB\-\-shell <string>\fP \- The shell to invoke the command with, if any\.
  38. .IP \(bu 2
  39. \fB\-\-shell\-auto\-fallback [<shell>]\fP \- Generates shell code to override your shell's "command not found" handler with one that calls \fBnpx\fP\|\. Tries to figure out your shell, or you can pass its name (either \fBbash\fP, \fBfish\fP, or \fBzsh\fP) as an option\. See below for how to install\.
  40. .IP \(bu 2
  41. \fB\-\-ignore\-existing\fP \- If this flag is set, npx will not look in \fB$PATH\fP, or in the current package's \fBnode_modules/\.bin\fP for an existing version before deciding whether to install\. Binaries in those paths will still be available for execution, but will be shadowed by any packages requested by this install\.
  42. .IP \(bu 2
  43. \fB\-q, \-\-quiet\fP \- Suppressed any output from npx itself (progress bars, error messages, install reports)\. Subcommand output itself will not be silenced\.
  44. .IP \(bu 2
  45. \fB\-n, \-\-node\-arg\fP \- Extra node argument to supply to node when binary is a node script\. You can supply this option multiple times to add more arguments\.
  46. .IP \(bu 2
  47. \fB\-v, \-\-version\fP \- Show the current npx version\.
  48. .RE
  49. .SH EXAMPLES
  50. .SS Running a project\-local bin
  51. .P
  52. .RS 2
  53. .nf
  54. $ npm i \-D webpack
  55. $ npx webpack \.\.\.
  56. .fi
  57. .RE
  58. .SS One\-off invocation without local installation
  59. .P
  60. .RS 2
  61. .nf
  62. $ npm rm webpack
  63. $ npx webpack \-\- \.\.\.
  64. $ cat package\.json
  65. \|\.\.\.webpack not in "devDependencies"\.\.\.
  66. .fi
  67. .RE
  68. .SS Invoking a command from a github repository
  69. .P
  70. .RS 2
  71. .nf
  72. $ npx github:piuccio/cowsay
  73. \|\.\.\.or\.\.\.
  74. $ npx git+ssh://my\.hosted\.git:cowsay\.git#semver:^1
  75. \|\.\.\.etc\.\.\.
  76. .fi
  77. .RE
  78. .SS Execute a full shell command using one npx call w/ multiple packages
  79. .P
  80. .RS 2
  81. .nf
  82. $ npx \-p lolcatjs \-p cowsay \-c \\
  83. 'echo "$npm_package_name@$npm_package_version" | cowsay | lolcatjs'
  84. \|\.\.\.
  85. _____
  86. < your\-cool\-package@1\.2\.3 >
  87. \-\-\-\-\-
  88. \\ ^__^
  89. \\ (oo)\\_______
  90. (__)\\ )\\/\\
  91. ||\-\-\-\-w |
  92. || ||
  93. .fi
  94. .RE
  95. .SS Run node binary with \-\-inspect
  96. .P
  97. .RS 2
  98. .nf
  99. $ npx \-\-node\-arg=\-\-inspect cowsay
  100. Debugger listening on ws://127\.0\.0\.1:9229/\.\.\.\.
  101. .fi
  102. .RE
  103. .SS Specify a node version to run npm scripts (or anything else!)
  104. .P
  105. .RS 2
  106. .nf
  107. npx \-p node@8 npm run build
  108. .fi
  109. .RE
  110. .SH SHELL AUTO FALLBACK
  111. .P
  112. You can configure \fBnpx\fP to run as your default fallback command when you type something in the command line with an \fB@\fP but the command is not found\. This includes installing packages that were not found in the local prefix either\.
  113. .P
  114. For example:
  115. .P
  116. .RS 2
  117. .nf
  118. $ npm@4 \-\-version
  119. (stderr) npm@4 not found\. Trying with npx\.\.\.
  120. 4\.6\.1
  121. $ asdfasdfasf
  122. zsh: command not found: asfdasdfasdf
  123. .fi
  124. .RE
  125. .P
  126. Currently, \fBzsh\fP, \fBbash\fP (>= 4), and \fBfish\fP are supported\. You can access these completion scripts using \fBnpx \-\-shell\-auto\-fallback <shell>\fP\|\.
  127. .P
  128. To install permanently, add the relevant line below to your \fB~/\.bashrc\fP, \fB~/\.zshrc\fP, \fB~/\.config/fish/config\.fish\fP, or as needed\. To install just for the shell session, simply run the line\.
  129. .P
  130. You can optionally pass through \fB\-\-no\-install\fP when generating the fallback to prevent it from installing packages if the command is missing\.
  131. .SS For bash@>=4:
  132. .P
  133. .RS 2
  134. .nf
  135. $ source <(npx \-\-shell\-auto\-fallback bash)
  136. .fi
  137. .RE
  138. .SS For zsh:
  139. .P
  140. .RS 2
  141. .nf
  142. $ source <(npx \-\-shell\-auto\-fallback zsh)
  143. .fi
  144. .RE
  145. .SS For fish:
  146. .P
  147. .RS 2
  148. .nf
  149. $ source (npx \-\-shell\-auto\-fallback fish | psub)
  150. .fi
  151. .RE
  152. .SH ACKNOWLEDGEMENTS
  153. .P
  154. Huge thanks to Kwyn Meagher \fIhttps://blog\.kwyn\.io\fR for generously donating the package name in the main npm registry\. Previously \fBnpx\fP was used for a Tessel board Neopixels library, which can now be found under \fBnpx\-tessel\fP \fIhttps://npm\.im/npx\-tessel\fR\|\.
  155. .SH AUTHOR
  156. .P
  157. Written by Kat Marchan \fIhttps://github\.com/zkat\fR\|\.
  158. .SH REPORTING BUGS
  159. .P
  160. Please file any relevant issues on Github\. \fIhttps://github\.com/zkat/npx\fR
  161. .SH LICENSE
  162. .P
  163. This work is released by its authors into the public domain under CC0\-1\.0\. See \fBLICENSE\.md\fP for details\.
  164. .SH SEE ALSO
  165. .RS 0
  166. .IP \(bu 2
  167. \fBnpm(1)\fP
  168. .IP \(bu 2
  169. \fBnpm\-run\-script(1)\fP
  170. .IP \(bu 2
  171. \fBnpm\-config(7)\fP
  172. .RE