How to use the upath.sep function in upath

To help you get started, we’ve selected a few upath examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pingyhq / pingy-cli / packages / middleware / lib / helpers.js View on Github external
getFullPath: function getFullPath(mountPath, url) {
    if (url.indexOf('://')) {
      url = urlLib.parse(url).pathname;
    }
    const base = unescape(url.split('?')[0]);
    let fullPath = path.join(mountPath, base);

    // converts unix paths to windows path on windows (not sure if this is a good thing)
    fullPath = path.normalize(fullPath);

    // index.html support
    if (path.sep === fullPath[fullPath.length - 1]) {
      fullPath += 'index.html';
    }
    return fullPath;
  },
github qooxdoo / qooxdoo-compiler / source / class / qx / tool / cli / commands / package / Install.js View on Github external
let download_path = parts.reduce((prev, current) => {
        let dir = prev + path.sep + current;
        if (!fs.existsSync(dir)) {
          fs.mkdirSync(dir);
          dir_exists = false;
        } else {
          dir_exists = true;
        }
        return dir;
      });
      // download zip
github GoogleChrome / workbox / gulp-tasks / transpile-typescript.js View on Github external
watcher.on('all', async (event, file) => {
    const changedPkg = path.relative(packagesDir, file).split(path.sep)[0];

    pendingChangesMap[changedPkg] = true;
    await queueTranspile(changedPkg);
    pendingChangesMap[changedPkg] = false;
  });
});

upath

A proxy to `path`, replacing `\` with `/` for all results (supports UNC paths) & new methods to normalize & join keeping leading `./` and add, change, default, trim file extensions.

MIT
Latest version published 4 years ago

Package Health Score

67 / 100
Full package analysis