Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 721 Bytes

README.md

File metadata and controls

35 lines (24 loc) · 721 Bytes

glob-observable

A Simple Observable interface over node-glob.

Example

Install

npm install simple-glob-observable
const fs = require('fs')
const glob = require('simple-glob-observable')
const { map } = require('rxjs/operators/map')
const { max } = require('rxjs/operators/max')

glob('./**', { ignore: 'node_modules/**' })
  .pipe(
    map(p => ({ size: fs.statSync(p).size, path: p })),
    max((x, y) => x.size > y.size)
  )
  .subscribe(c => console.log('max size file:', c.path))

Usage

glob(pattern, [options])

Options

sync: perform a synchronous glob search, default is false.

see node-glob for more details.