GithubHelp home page GithubHelp logo

finder's Introduction

Finder

api

  • contains(substr)
  • pathContains(substr)
  • pathExcludes(substr)
  • lte(size, unit)
  • lt(size, unit)
  • gte(size, unit)
  • gt(size, unit)
  • in()
  • include()
  • exclude()
  • maxDepth(level)
  • filter(fn)
  • find(includeStats = false)
  • findStat(prop)
  • sizes(unit = 'bytes')
  • cTimes()
  • mTimes()

example

{Finder} = require './Finder'

finder = new Finder

search = finder.in([
    'Symfony'
]).maxDepth(2).include([
    'php'
])

files = search.find()

console.log files

###
[ 'Symfony/app/AppCache.php',
  'Symfony/app/AppKernel.php',
  'Symfony/app/autoload.php',
  'Symfony/app/check.php',
  'Symfony/vendor/symfony/vendors.php',
  'Symfony/web/app.php',
  'Symfony/web/app_dev.php',
  'Symfony/web/config.php' ]
###

sizes = search.sizes 'kb'

console.log sizes

###
{ 'Symfony/app/AppCache.php': 0.1376953125,
  'Symfony/app/AppKernel.php': 1.3798828125,
  'Symfony/app/autoload.php': 1.7978515625,
  'Symfony/app/check.php': 5.888671875,
  'Symfony/vendor/symfony/vendors.php': 1.40625,
  'Symfony/web/app.php': 0.3486328125,
  'Symfony/web/app_dev.php': 0.671875,
  'Symfony/web/config.php': 8.1748046875 }
###  
 
search.gte 1, 'kb'

res = search.sizes 'kb'

console.log res

###
{ 'Symfony/app/AppKernel.php': 1.3798828125,
  'Symfony/app/autoload.php': 1.7978515625,
  'Symfony/app/check.php': 5.888671875,
  'Symfony/vendor/symfony/vendors.php': 1.40625,
  'Symfony/web/config.php': 8.1748046875 }
###

search.pathContains 'vendor'

res = search.sizes 'kb'

console.log res

###
{ 'Symfony/vendor/symfony/vendors.php': 1.40625 }
###

finder's People

Contributors

stewartrule avatar

Stargazers

Maurice Fonk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.