1.4.0 • Published 10 years ago
vinyl-globby v1.4.0
vinyl-globby
Like globby, but returns vinyl objects instead of filepaths. Useful when you want to know the relative path to a file from its associated glob pattern.
Example
var vinylGlobby = require("vinyl-globby");
// Standard interface
vinylGlobby(['**/*.js', '!foo.js'], function onGlob(err, files) {
files[0].path; // Full file path
files[0].base; // Base from start of glob
files[0].relative; // Relative file path to base
});
// Emitter interface
var globber = vinylGlobby('**/*.js');
globber.on('match', onMatch);
globber.on('error', onError);
globber.on('end', onEnd);
// You can also abort the globbing, which will fire an "abort" event
globber.abort();Installation
npm install vinyl-globby
Tests
npm test
NPM scripts
npm run coverThis runs the tests with code coveragenpm run lintThis will run the linter on your codenpm testThis will run the tests.npm run traceThis will run your tests in tracing mode.npm run travisThis is run by travis.CI to run your testsnpm run view-coverThis will show code coverage in a browser
Contributors
- Matt Morgan


