How to use the path-type.isDirectory function in path-type

To help you get started, we’ve selected a few path-type 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 kevva / dir-glob / index.js View on Github external
const globs = await Promise.all([].concat(input).map(async x => {
		const isDirectory = await pathType.isDirectory(getPath(x, options.cwd));
		return isDirectory ? getGlob(x, options) : x;
	}));
github davidtheclark / cosmiconfig / src / getDirectory.ts View on Github external
async function getDirectory(filepath: string): Promise {
  const filePathIsDirectory = await isDirectory(filepath);

  if (filePathIsDirectory === true) {
    return filepath;
  }

  const directory = path.dirname(filepath);

  return directory;
}

path-type

Check if a path is a file, directory, or symlink

MIT
Latest version published 3 years ago

Package Health Score

70 / 100
Full package analysis