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.

generate-require.js 650B

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. const path = require('path');
  3. const needsPathRegExp = /[\\ "]/;
  4. const needsPathEnv = dir => needsPathRegExp.test(dir);
  5. function generateRequire(filename) {
  6. if (needsPathEnv(filename)) {
  7. return `--require ${path.basename(filename)}`;
  8. }
  9. return `--require ${filename}`;
  10. }
  11. function processNodePath(value) {
  12. const dir = path.dirname(require.resolve('./preload-path/node-preload.js'));
  13. const existing = value === '' ? [] : value.split(path.delimiter);
  14. if (existing.includes(dir)) {
  15. return value;
  16. }
  17. return existing.concat(dir).join(path.delimiter);
  18. }
  19. module.exports = {
  20. generateRequire,
  21. processNodePath,
  22. needsPathEnv
  23. };