lib/poet/utils.js
function getPostPaths (dir) {
  return fs.readdir(dir).then(function (files) {
    return all(files.map(function (file) {
      var path = pathify(dir, file);
      return fs.stat(path).then(function (stats) {
        return stats.isDirectory() ?
          getPostPaths(path) :
          path;
      });
    }));
  }).then(function (files) {
    return _.flatten(files);
  });
}
function getPostPaths (dir) {
  return fs.readdir(dir).then(function (files) {
    return all(files.map(function (file) {
      var path = pathify(dir, file);
      return fs.stat(path).then(function (stats) {
        return stats.isDirectory() ?
          getPostPaths(path) :
          path;
      });
    }));
  }).then(function (files) {
    return _.flatten(files);
  });
}
function getPostPaths ( dir ) { return fs . readdir ( dir ) . then ( function ( files ) { return all ( files . map ( function ( file ) { var path = pathify ( dir , file ) ; return fs . stat ( path ) . then ( function ( stats ) { return stats . isDirectory ( ) ? getPostPaths ( path ) : path ; } ) ; } ) ) ; } ) . then ( function ( files ) { return _ . flatten ( files ) ; } ) ; }
Recursively search `dir` and return all file paths as strings in
an array

@params {String} dir
@returns {Array}
Recursively search dir and return all file paths as strings in an array