unglobbable

A glob pattern that lets node-glob emit an error

ISC 3 个版本
安装
npm install unglobbable
yarn add unglobbable
pnpm add unglobbable
bun add unglobbable
README

unglobbable

npm version Build Status Build status

A glob pattern that lets node-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

Installation

Use npm.

npm install unglobbable

API

const unglobbable = require('unglobbable');

unglobbable

Value: string of the following:

Platform String
Darwin /private/var/root/*
Linux /proc/*/*/*/*
Windows /Documents and Settings/*
Others /**
// On macOS
const glob = require('glob');
const unglobbable = require('unglobbable');

unglobbable; //=> '/private/var/root/*'

glob(unglobbable, err => {
  err.message; //=> 'EACCES: permission denied, scandir '/private/var/root''
});

License

ISC License © 2018 Shinnosuke Watanabe

版本列表
1.0.1 2018-02-15
1.0.0 2017-01-27
0.0.0 2017-01-20