normalize-glob

0.0.2 • Public • Published

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.

Package Sidebar

Install

npm i normalize-glob

Weekly Downloads

229

Version

0.0.2

License

MIT

Unpacked Size

7.86 kB

Total Files

6

Last publish

Collaborators

  • ajaff