terkelg / tiny-glob

Super tiny and ~350% faster alternative to node-glob
MIT License
856 stars 25 forks source link

Support negate `!` #43

Closed beeing closed 5 years ago

beeing commented 5 years ago

Hi, does it support the negate !(pattern-list) ?

RedHatter commented 5 years ago

It does indeed. For example

const glob = require('tiny-glob')
const files = await glob('!(node_modules|public)/**/*.{mjs,js,jsx}')
terkelg commented 5 years ago

Thank you @RedHatter

chris-kruining commented 2 years ago

there does seem to be a bug though:

import glob from 'tiny-glob';

console.log(await glob('src/**/!(*.d).ts'));

gives

[
  'src\\common\\query_pb.d.ts',
  'src\\service\\cms\\v1\\FileServiceClientPb.ts',
  'src\\service\\cms\\v1\\file_pb.d.ts',
  'src\\service\\identity\\v1\\IdentityServiceClientPb.ts',
  'src\\service\\identity\\v1\\identity_pb.d.ts',
  'src\\type\\cms\\file_pb.d.ts'
]