How to use the canonical-path.normalize function in canonical-path

To help you get started, we’ve selected a few canonical-path 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 oxyflour / yalls / index.js View on Github external
var makeRequire = (base, root) => (path, callback) => {
    var dir = dirName(base) || '.',
    	url = cononicalPath.normalize(dir + '/' + path + '.lua')

    ;(DEPENDENCY_MAP[base] || (DEPENDENCY_MAP[base] = { }))[url] = 1
    if (checkDependency(base, url))
        throw 'circular dependency found between `' + base + '` and `' + url + '` !'

    // use async loader
    if (callback !== undefined) {
	    if (!IMPORT_CACHE[url])
	        IMPORT_CACHE[url] = doRequireAsync(url, root)
	    IMPORT_CACHE[url].then(callback)
    }
    // use sync loader
    else {
    	if (!IMPORT_CACHE[url])
    		IMPORT_CACHE[url] = doRequireSync(url, root)
    	return IMPORT_CACHE[url]
github angular-ui / ui-grid / lib / grunt / plugins.js View on Github external
newFileName = basename + extension + ext;
        }
        else {
          newFileName = basename + ext;
        }

        // If this is a stable release
        if (releaseDir) {
          // Create the stable directory if it doesn't exist
          if (!fs.existsSync(releaseDir)) {
            fs.mkdirSync(releaseDir);
          }

          var releasePath = path.join(releaseDir, oldFileName);

          if (path.normalize(f) !== path.normalize(releasePath)) {
            grunt.log.writeln('Copying ' + f + ' to ' + releasePath);
            // fs.createReadStream(f).pipe(fs.createWriteStream(stablePath));
            shell.cp('-f', f, releasePath);
          }
        }

        var newPath = path.join(file.dest, newFileName);

        if (path.normalize(f) !== path.normalize(newPath)) {
          grunt.log.writeln('Copying ' + f + ' to ' + newPath);
          // fs.createReadStream(f).pipe(fs.createWriteStream(newPath));
          shell.cp('-f', f, newPath);
        }

        if (options.cleanup && path.normalize(f) !== path.normalize(newPath)) {
          grunt.log.writeln('Unlinking ' + f, newPath);
github nikhilmodak / gulp-ngdocs / index.js View on Github external
options.styles = _.map(options.styles, function(file) {
      var fileName = path.normalize(file);
    if (/^((https?:)?\/\/)/.test(file)) {
      return file;
    } else {
      fstreams.push(streamFile(file, path.join('css', path.dirname(fileName)), fakeDest));
      return path.join('css', fileName);
    }
  });
github nikhilmodak / gulp-ngdocs / index.js View on Github external
options.scripts = _.map(options.scripts, function (file) {
    var fileName = path.normalize(file);
    scriptNames.push(fileName);
    if (/^((https?:)?\/\/)/.test(file)) {
      return file;
    } else {
      fstreams.push(streamFile(file, path.join('js', path.dirname(fileName)), fakeDest));
      return path.join('js', fileName);
    }
  });
github nikhilmodak / gulp-ngdocs / index.js View on Github external
_.forEach(defaultScripts, function (script, i) {
    var fileName = path.normalize(script).split('/').pop();
    if (scriptNames.indexOf(fileName) === -1) {
      fstreams.push(streamFile(script, 'js', fakeDest));
      options.scripts.splice(i, 0, path.join('js', fileName));
    }
  });
github Quramy / generator-ngdoc / app / templates / docs / lib / bowerCommonFiles.js View on Github external
_(main).map(function (file) {
    return path.relative(path.normalize(bowerDir), path.normalize(file));
  }).filter(function (file) {
    var res = false;

canonical-path

paths that always use forward slashes

MIT
Latest version published 6 years ago

Package Health Score

50 / 100
Full package analysis