lib/index.js
function globcmd(globstr) {
  var dir = arguments.length <= 1 || arguments[1] === undefined ? process.cwd() : arguments[1];

  return new Promise(function (resolve, reject) {
    if (!globstr || !globstr.length) {
      return reject(new Error('No glob string given.'));
    }

    // Use glob to read the files in the dir
    (0, _glob2.default)(String(globstr), { cwd: dir }, function (err, files) {
      if (err) return reject(err);

      // Files
      if (files.length === 0) {
        reject(new Error('No files match the glob string "' + globstr + '"'));
      }

      // Append the matching file to an array
      resolve(files.map(function (filename) {
        return {
          path: _path2.default.resolve(dir, filename),
          relative: _path2.default.relative(dir, filename)
        };
      }));
    });
  });
}
function globcmd(globstr) {
  var dir = arguments.length <= 1 || arguments[1] === undefined ? process.cwd() : arguments[1];

  return new Promise(function (resolve, reject) {
    if (!globstr || !globstr.length) {
      return reject(new Error('No glob string given.'));
    }

    // Use glob to read the files in the dir
    (0, _glob2.default)(String(globstr), { cwd: dir }, function (err, files) {
      if (err) return reject(err);

      // Files
      if (files.length === 0) {
        reject(new Error('No files match the glob string "' + globstr + '"'));
      }

      // Append the matching file to an array
      resolve(files.map(function (filename) {
        return {
          path: _path2.default.resolve(dir, filename),
          relative: _path2.default.relative(dir, filename)
        };
      }));
    });
  });
}
function globcmd ( globstr ) { var dir = arguments . length <= 1 || arguments [ 1 ] === undefined ? process . cwd ( ) : arguments [ 1 ] ; return new Promise ( function ( resolve , reject ) { if ( ! globstr || ! globstr . length ) { return reject ( new Error ( 'No glob string given.' ) ) ; } // Use glob to read the files in the dir ( 0 , _glob2 . default ) ( String ( globstr ) , { cwd : dir } , function ( err , files ) { if ( err ) return reject ( err ) ; // Files if ( files . length === 0 ) { reject ( new Error ( 'No files match the glob string "' + globstr + '"' ) ) ; } // Append the matching file to an array resolve ( files . map ( function ( filename ) { return { path : _path2 . default . resolve ( dir , filename ) , relative : _path2 . default . relative ( dir , filename ) } ; } ) ) ; } ) ; } ) ; }
Globcmd
Returns a promise that will be resolved with an array of files

@param {string} globstr - Glob str to look for
@param {string} [dir=process.cwd()] - Root directory
@returns {Promise} A promise object to be resolved with an array of files
or rejected with an error.
Globcmd Returns a promise that will be resolved with an array of files