Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 

15 рядки
530 B

  1. /*
  2. * getAbsoluteFSPath
  3. * @return {string} When run in NodeJS env, returns the absolute path to the current directory
  4. * When run outside of NodeJS, will return an error message
  5. */
  6. const getAbsoluteFSPath = function () {
  7. // detect whether we are running in a browser or nodejs
  8. if (typeof module !== "undefined" && module.exports) {
  9. return require("path").resolve(__dirname)
  10. }
  11. throw new Error('getAbsoluteFSPath can only be called within a Nodejs environment');
  12. }
  13. module.exports = getAbsoluteFSPath