A glob pattern that lets node-glob and fast-glob emit an error
const glob = require('glob');
const unglobbable = require('unglobbable');
glob('safe/glob/pattern', err => {
!!err; //=> false
});
glob(unglobbable, err => {
!!err; //=> true
});
Useful for writing the failure test case. Example
npm install unglobbable
import unglobbable from 'unglobbable';
Value: string
of the following:
Platform | String |
---|---|
Darwin | /private/var/root/* |
Linux | /proc/*/*/*/* |
Windows | /Documents and Settings/* |
Others | /** |
// On macOS
import glob from 'glob';
import unglobbable from 'unglobbable'; //=> '/private/var/root/*'
glob(unglobbable, err => {
err.message; //=> 'EACCES: permission denied, scandir '/private/var/root''
});
ISC License © 2018 - 2019 Watanabe Shinnosuke