glob-rx v1.2.0
glob-rx
| Linux/OSX | Windows |
|---|---|
RxJS Wrapper around the glob function.
Usage
Install from NPM
npm install --save glob-rxUse it as an observable.
var globRx = require('glob-rx');
globRx(pattern, options)
.subscribe(
function(file) {
// .. do something with file
console.log(file.fullname);
},
function(err) {
// ... error handling
},
function() {
// ... end of files
});This module wraps the glob function in an observable, so the pattern and options parameters
are the same.
Output
The observable returns an object with two properties:
basedir- the base directory the pattern is relative to (corresponds to thecwdproperty in the options passed to the glob function).name- the file name relative to thebasedirproperty.
The object also supports a number of calculated properties to get additional information about the file.
fullname- returns the full name of the file (thebasedirplus thename).basename- returns the base filename without any path.dirname- return the full path, without the file name.extname- returns the file extension.
9 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago