gulp-finder
v1.0.4
Published
A plugin for Gulp
Downloads
29
Maintainers
Readme
gulp-finder
Directory Glob String plugin finder for gulp
Features
- Gulp Finder uses fs.extra and recursively searches through the given directory, and creates an object that mirrors your directory structure.
- Each directory within the Object now has a bunch of methods, which we will discuss down below.
- Each method will either return a string or an array of paths.
- Bind's a finder property to the the gulp instance.
you can call gulp-finder from any gulp task, by calling
this.finder(path)
Usage
First, install gulp-finder
as a development dependency:
npm install --save-dev gulp-finder
Then, add it to your gulpfile.js
:
// require gulp
var gulp = require('gulp');
// Do this
var finder = require('gulp-finder')(gulp);
// or do this
require('gulp-finder')(gulp);
gulp.task( 'any', function(){
var found = this.finder( './somePath/to/some/where' );
console.log(found)
//=> Object that looks similar to your directory.
});
API
finder['someDirectory'].path;
value
- Type: String
- Descr: The path property will be the full path to someDirectory
finder['someDirectory'].all( );
value
Type: String
Returns: the/full/path/to/the/current/directory + **/*
finder['someDirectory'].dirs( String
|| Array
);
arguments
Type: String || Array
Default: '**'
Required: false
finder['someDirectory'].ext( extension
);
extension
Type: String
Default: '*.*'
Required: false
finder['someDirectory'].any( String );
String
Type: String || Array
Default: '**'
Required: false
TODO
- Add More Methods
- Find a better Library for recursively searching the directory;