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.

index.js 532B

1234567891011121314151617181920212223
  1. 'use strict';
  2. var path = require('path');
  3. var Module = require('module');
  4. module.exports = function (fromDir, moduleId) {
  5. if (typeof fromDir !== 'string' || typeof moduleId !== 'string') {
  6. throw new TypeError('Expected `fromDir` and `moduleId` to be a string');
  7. }
  8. fromDir = path.resolve(fromDir);
  9. var fromFile = path.join(fromDir, 'noop.js');
  10. try {
  11. return Module._resolveFilename(moduleId, {
  12. id: fromFile,
  13. filename: fromFile,
  14. paths: Module._nodeModulePaths(fromDir)
  15. });
  16. } catch (err) {
  17. return null;
  18. }
  19. };