Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

normalize-glob

ajafff839MIT0.0.2TypeScript support: included

Normalize a glob pattern by expanding braces, making it absolute and resolving parent directories '..'

glob, absolute, resolve, normalize, expand

readme

normalize-glob

Normalize a glob pattern by expanding braces, making it absolute and resolving parent directories '..'.

Usage

import {normalizeGlob} from 'normalize-glob';

// using iteration protocol
for (const pattern of normalizeGlob('../foo/*', process.cwd())) {
    // use 'pattern'
}

// converting the result to an array
Array.from(normalizeGlob('../foo/*', process.cwd()));

Note that glob patterns are supposed to use forward slashes as directory separator. The cwd parameter may use backslashes as directory separator on windows.