Ohm-Management - Projektarbeit B-ME
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 992B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # resolve-from [![Build Status](https://travis-ci.org/sindresorhus/resolve-from.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-from)
  2. > Resolve the path of a module like [`require.resolve()`](http://nodejs.org/api/globals.html#globals_require_resolve) but from a given path
  3. ## Install
  4. ```
  5. $ npm install --save resolve-from
  6. ```
  7. ## Usage
  8. ```js
  9. const resolveFrom = require('resolve-from');
  10. // there's a file at `./foo/bar.js`
  11. resolveFrom('foo', './bar');
  12. //=> '/Users/sindresorhus/dev/test/foo/bar.js'
  13. ```
  14. ## API
  15. ### resolveFrom(fromDir, moduleId)
  16. #### fromDir
  17. Type: `string`
  18. The directory to resolve from.
  19. #### moduleId
  20. Type: `string`
  21. What you would use in `require()`.
  22. ## Tip
  23. Create a partial using a bound function if you want to require from the same `fromDir` multiple times:
  24. ```js
  25. const resolveFromFoo = resolveFrom.bind(null, 'foo');
  26. resolveFromFoo('./bar');
  27. resolveFromFoo('./baz');
  28. ```
  29. ## License
  30. MIT © [Sindre Sorhus](http://sindresorhus.com)