How to use the path.posix.join function in path

To help you get started, we’ve selected a few 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 alexisvincent / systemjs-config-builder / lib / index.js View on Github external
export const getOwnDeps = (packageDir) => {
    const node_modules = path.join(packageDir, 'node_modules')

    return pfs.access(node_modules)
        .then(() => getDirectories(node_modules))
        // Map directories to their package.json
        .then(dirs => Promise.all(dirs.map(dir => getPackageConfig(path.join(packageDir, 'node_modules', dir)))))
        // Filter out anything that wasn't a package
        .then(configs => configs.filter((v, k) => v))

        .catch(err => {
            // console.log(err)
            return []
        })
}
github dapphub / dapple / lib / linker.js View on Github external
static resolveImport (sources, sourcePath, importPath, workspace) {
    if (importPath in sources) {
      // Fully qualified import path.
      return importPath;
    }

    var importParts = importPath.split(path.sep);
    var packagePath1 = path.join(
      workspace.getPackageRoot(sourcePath),
      workspace.getPackagesDir(sourcePath),
      importParts[0]);
    var packagePath2 = path.join(
      workspace.getPackageRoot(sourcePath),
      'dapple_packages',
      importParts[0]);

    // TODO - refactor this based on dappfile version
    var testPackagePath = (packagePath) => {
      var exists = (packagePath === workspace.getPackageRoot(packagePath));

      if (!importPath.startsWith('./') && exists) {
        var resolvedPath = path.join.apply(path,
          [workspace.getSourcePath(packagePath)]
            .concat(importParts.slice(1)));
github dominique-mueller / angular-package-builder / src / composer / angular-package.composer.ts View on Github external
private async createPackageJsonForPrimaryEntry(): Promise {

		// Read package.json file
		const packageJsonPath: string = path.join( this.angularPackage.root, 'package.json' );
		const packageJson: any = await readFile( packageJsonPath );

		// Add entry properties
		const packageJsonWithEntryProperties: any = {
			...packageJson,
			...this.createEntryProperties()
		};

		// Write package.json file
		const packageJsonPathOut: string = path.join( this.angularPackage.root, this.angularPackage.outDir, 'package.json' );
		await writeFile( packageJsonPathOut, packageJsonWithEntryProperties );

	}
github mochajs / mocha / test / integration / options / bail.spec.js View on Github external
it('should stop all tests after failing "after" hook', function(done) {
    var fixture = path.join('options', 'bail-with-after');
    runMochaJSON(fixture, args, function(err, res) {
      if (err) {
        return done(err);
      }

      expect(res, 'to have failed')
        .and('to have failed test count', 1)
        .and(
          'to have failed test',
          '"after all" hook: after suite1A for "test suite1A"'
        )
        .and('to have passed test count', 2)
        .and('to have passed test order', 'test suite1', 'test suite1A');
      done();
    });
  });
github easy-team / easywebpack / test / helper.js View on Github external
exports.createBuilder = config => {
  const builder = new WebpackBaseBuilder(config);
  builder.setBuildPath(path.join(__dirname, '../dist/loader'));
  builder.setPublicPath('/public');
  builder.setEntry({
    include: path.join(__dirname, '../test')
  });
  return builder;
};
github smartive / kuby / test / commands / kubectl / kubectl.remove.spec.ts View on Github external
beforeEach(() => {
    vol.fromJSON({
      [posix.join(Filepathes.kubectlInstallPath, 'v1.12.1', 'kubectl')]: 'kubectl',
      [posix.join(Filepathes.kubectlInstallPath, 'v1.12.2', 'kubectl')]: 'kubectl',
      [posix.join(Filepathes.kubectlInstallPath, 'v1.10.0', 'kubectl')]: 'kubectl',
      [posix.join(Filepathes.kubectlInstallPath, 'v1.8.4', 'kubectl')]: 'kubectl',
    });
    vol.mkdirpSync('/usr/local/bin/');
    vol.symlinkSync(posix.join(Filepathes.kubectlInstallPath, 'v1.10.0', 'kubectl'), '/usr/local/bin/kubectl');
  });
github gourmetjs / gourmet-ssr / utils / storage-s3 / gmsrc / StorageS3.js View on Github external
_getKey(path) {
    path = posix.join(this.basePath, path);
    return path[0] === "/" ? path.substr(1) : path;
  }
github wix-incubator / corvid / packages / corvid-local-site / src / readWrite.js View on Github external
...map_(DEFAULT_FILE_PATHS, dirOrFilePath =>
        fs.ensureFile(path.join(siteRootPath, dirOrFilePath))
      )
github ali322 / nva / packages / nva-task / lib / isomorphic / webpack.hot-update.js View on Github external
const vendorAssets = (modVendor, type) => {
    if (isPlainObject(sourcemap[type])) {
      if (Array.isArray(modVendor[type])) {
        return modVendor[type]
          .filter(k => typeof sourcemap[type][k] === 'string')
          .map(k => posix.join(posix.sep, vendorDevFolder, sourcemap[type][k]))
      }
      return typeof sourcemap[type][modVendor[type]] === 'string'
        ? [
          posix.join(
            posix.sep,
            vendorDevFolder,
            sourcemap[type][modVendor[type]]
          )
        ]
        : []
    }
    return []
  }
github Fitbit / fitbit-sdk-toolchain / src / rollupToVinyl.ts View on Github external
function generatePath(fileName: string) {
    return outputOptions.dir
      ? posix.join(outputOptions.dir, fileName)
      : fileName;
  }