mklabs / node-fileset Goto Github PK
View Code? Open in Web Editor NEWWrapper around miniglob / minimatch combo to allow multiple patterns matching and include-exclude ability
License: MIT License
Wrapper around miniglob / minimatch combo to allow multiple patterns matching and include-exclude ability
License: MIT License
test case: a
directory include ms.js
directory which contain index.js
like this:
a
└── ms.js
└── index.js
I only want index.js so use nodir option for glob to exclude ms.js
directory:
fileset('**/*.js', '', {nodir: true}, function(err, files) {
console.log(files);
});
Expected: only print index.js
Actually: print index.js
and ms.js
And remove the dependency to minimatch.
In my experience both - 'match' and 'include' events produce the same output. Would be more useful if 'match' fired on every match - be it include or exclude entry and 'include' - fired only for the files that will be included in the final fileset.
The documentation mentions that you can check multiple patterns like so:
fileset('**.coffee README.md *.json Cakefile **.js', 'node_modules/**')
Is there any way to use this library with paths that have spaces in them? I've tried surrounding the path in quotes... "/bravado site/views/**/*.hbs"
to no avail.
Switch to mocha
Just FYI, the version of minimatch is causing some issues for those running Node 0.8 see minimatch#35 . Any chance we can clamp down the package.json for fileset to 0.2.X?
Nevermind
Really neat library.
Would it be possible to add a (preferably MIT) license so I can use it in settings where these things matter?
Thanks in advance,
Krishnan
Related to #14
Ex: include /bla/./bla/**/*
, exclude /bla/./bla/_*
don't work "as expected".
Since my problem is in a grunt context, I just normalize my needed paths before playing with some *
.
Sync API
now that glob allows it => glob.sync()
Test suite no longer pass. fileset needs an update in its test suite to make it pass again.
cc @Marsup
minimatch version <3.0.1 has an exploit
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.