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.

readme.md 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. # npm-run-path [![Build Status](https://travis-ci.org/sindresorhus/npm-run-path.svg?branch=master)](https://travis-ci.org/sindresorhus/npm-run-path)
  2. > Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries
  3. In [npm run scripts](https://docs.npmjs.com/cli/run-script) you can execute locally installed binaries by name. This enables the same outside npm.
  4. ## Install
  5. ```
  6. $ npm install npm-run-path
  7. ```
  8. ## Usage
  9. ```js
  10. const childProcess = require('child_process');
  11. const npmRunPath = require('npm-run-path');
  12. console.log(process.env.PATH);
  13. //=> '/usr/local/bin'
  14. console.log(npmRunPath());
  15. //=> '/Users/sindresorhus/dev/foo/node_modules/.bin:/Users/sindresorhus/dev/node_modules/.bin:/Users/sindresorhus/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/usr/local/bin'
  16. // `foo` is a locally installed binary
  17. childProcess.execFileSync('foo', {
  18. env: npmRunPath.env()
  19. });
  20. ```
  21. ## API
  22. ### npmRunPath(options?)
  23. Returns the augmented path string.
  24. #### options
  25. Type: `object`
  26. ##### cwd
  27. Type: `string`<br>
  28. Default: `process.cwd()`
  29. Working directory.
  30. ##### path
  31. Type: `string`<br>
  32. Default: [`PATH`](https://github.com/sindresorhus/path-key)
  33. PATH to be appended.<br>
  34. Set it to an empty string to exclude the default PATH.
  35. ##### execPath
  36. Type: `string`<br>
  37. Default: `process.execPath`
  38. Path to the current Node.js executable. Its directory is pushed to the front of PATH.
  39. This can be either an absolute path or a path relative to the [`cwd` option](#cwd).
  40. ### npmRunPath.env(options?)
  41. Returns the augmented [`process.env`](https://nodejs.org/api/process.html#process_process_env) object.
  42. #### options
  43. Type: `object`
  44. ##### cwd
  45. Type: `string`<br>
  46. Default: `process.cwd()`
  47. Working directory.
  48. ##### env
  49. Type: `Object`
  50. Accepts an object of environment variables, like `process.env`, and modifies the PATH using the correct [PATH key](https://github.com/sindresorhus/path-key). Use this if you're modifying the PATH for use in the `child_process` options.
  51. ##### execPath
  52. Type: `string`<br>
  53. Default: `process.execPath`
  54. Path to the Node.js executable to use in child processes if that is different from the current one. Its directory is pushed to the front of PATH.
  55. This can be either an absolute path or a path relative to the [`cwd` option](#cwd).
  56. ## Related
  57. - [npm-run-path-cli](https://github.com/sindresorhus/npm-run-path-cli) - CLI for this module
  58. - [execa](https://github.com/sindresorhus/execa) - Execute a locally installed binary
  59. ---
  60. <div align="center">
  61. <b>
  62. <a href="https://tidelift.com/subscription/pkg/npm-npm-run-path?utm_source=npm-npm-run-path&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
  63. </b>
  64. <br>
  65. <sub>
  66. Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
  67. </sub>
  68. </div>