Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FSWatcher

Hierarchy

  • EventEmitter
  • EventEmitter
  • EventEmitter
  • EventEmitter
  • EventEmitter
  • EventEmitter
  • EventEmitter

Implements

  • FSWatcher
  • FSWatcher
  • FSWatcher
  • FSWatcher
  • FSWatcher
  • FSWatcher
  • FSWatcher

Index

Constructors

constructor

  • Constructs a new FSWatcher instance with optional WatchOptions parameter.

    Parameters

    Returns FSWatcher

  • Constructs a new FSWatcher instance with optional WatchOptions parameter.

    Parameters

    • Optional options: WatchOptions

    Returns FSWatcher

  • Constructs a new FSWatcher instance with optional WatchOptions parameter.

    Parameters

    • Optional options: WatchOptions

    Returns FSWatcher

  • Constructs a new FSWatcher instance with optional WatchOptions parameter.

    Parameters

    • Optional options: WatchOptions

    Returns FSWatcher

  • Constructs a new FSWatcher instance with optional WatchOptions parameter.

    Parameters

    • Optional options: WatchOptions

    Returns FSWatcher

  • Constructs a new FSWatcher instance with optional WatchOptions parameter.

    Parameters

    • Optional options: WatchOptions

    Returns FSWatcher

  • Constructs a new FSWatcher instance with optional WatchOptions parameter.

    Parameters

    • Optional options: WatchOptions

    Returns FSWatcher

Properties

Static defaultMaxListeners

defaultMaxListeners: number

Methods

add

  • add(paths: string | string[]): void
  • add(paths: string | string[]): void
  • add(paths: string | string[]): void
  • add(paths: string | string[]): void
  • add(paths: string | string[]): void
  • add(paths: string | string[]): void
  • add(paths: string | string[]): void
  • Add files, directories, or glob patterns for tracking. Takes an array of strings or just one string.

    Parameters

    • paths: string | string[]

    Returns void

  • Add files, directories, or glob patterns for tracking. Takes an array of strings or just one string.

    Parameters

    • paths: string | string[]

    Returns void

  • Add files, directories, or glob patterns for tracking. Takes an array of strings or just one string.

    Parameters

    • paths: string | string[]

    Returns void

  • Add files, directories, or glob patterns for tracking. Takes an array of strings or just one string.

    Parameters

    • paths: string | string[]

    Returns void

  • Add files, directories, or glob patterns for tracking. Takes an array of strings or just one string.

    Parameters

    • paths: string | string[]

    Returns void

  • Add files, directories, or glob patterns for tracking. Takes an array of strings or just one string.

    Parameters

    • paths: string | string[]

    Returns void

  • Add files, directories, or glob patterns for tracking. Takes an array of strings or just one string.

    Parameters

    • paths: string | string[]

    Returns void

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

close

  • close(): void
  • close(): void
  • close(): void
  • close(): void
  • close(): void
  • close(): void
  • close(): void
  • Removes all listeners from watched files.

    Returns void

  • Removes all listeners from watched files.

    Returns void

  • Removes all listeners from watched files.

    Returns void

  • Removes all listeners from watched files.

    Returns void

  • Removes all listeners from watched files.

    Returns void

  • Removes all listeners from watched files.

    Returns void

  • Removes all listeners from watched files.

    Returns void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getWatched

  • getWatched(): WatchedPaths
  • getWatched(): WatchedPaths
  • getWatched(): WatchedPaths
  • getWatched(): WatchedPaths
  • getWatched(): WatchedPaths
  • getWatched(): WatchedPaths
  • getWatched(): WatchedPaths
  • Returns an object representing all the paths on the file system being watched by this FSWatcher instance. The object's keys are all the directories (using absolute paths unless the cwd option was used), and the values are arrays of the names of the items contained in each directory.

    Returns WatchedPaths

  • Returns an object representing all the paths on the file system being watched by this FSWatcher instance. The object's keys are all the directories (using absolute paths unless the cwd option was used), and the values are arrays of the names of the items contained in each directory.

    Returns WatchedPaths

  • Returns an object representing all the paths on the file system being watched by this FSWatcher instance. The object's keys are all the directories (using absolute paths unless the cwd option was used), and the values are arrays of the names of the items contained in each directory.

    Returns WatchedPaths

  • Returns an object representing all the paths on the file system being watched by this FSWatcher instance. The object's keys are all the directories (using absolute paths unless the cwd option was used), and the values are arrays of the names of the items contained in each directory.

    Returns WatchedPaths

  • Returns an object representing all the paths on the file system being watched by this FSWatcher instance. The object's keys are all the directories (using absolute paths unless the cwd option was used), and the values are arrays of the names of the items contained in each directory.

    Returns WatchedPaths

  • Returns an object representing all the paths on the file system being watched by this FSWatcher instance. The object's keys are all the directories (using absolute paths unless the cwd option was used), and the values are arrays of the names of the items contained in each directory.

    Returns WatchedPaths

  • Returns an object representing all the paths on the file system being watched by this FSWatcher instance. The object's keys are all the directories (using absolute paths unless the cwd option was used), and the values are arrays of the names of the items contained in each directory.

    Returns WatchedPaths

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: "add" | "addDir" | "change", listener: function): this
  • on(event: "all", listener: function): this
  • on(event: "error", listener: function): this
  • on(event: "raw", listener: function): this
  • on(event: "ready", listener: function): this
  • on(event: "unlink" | "unlinkDir", listener: function): this
  • on(event: string, listener: function): this
  • on(event: "add" | "addDir" | "change", listener: function): this
  • on(event: "all", listener: function): this
  • on(event: "error", listener: function): this
  • on(event: "raw", listener: function): this
  • on(event: "ready", listener: function): this
  • on(event: "unlink" | "unlinkDir", listener: function): this
  • on(event: string, listener: function): this
  • on(event: "add" | "addDir" | "change", listener: function): this
  • on(event: "all", listener: function): this
  • on(event: "error", listener: function): this
  • on(event: "raw", listener: function): this
  • on(event: "ready", listener: function): this
  • on(event: "unlink" | "unlinkDir", listener: function): this
  • on(event: string, listener: function): this
  • on(event: "add" | "addDir" | "change", listener: function): this
  • on(event: "all", listener: function): this
  • on(event: "error", listener: function): this
  • on(event: "raw", listener: function): this
  • on(event: "ready", listener: function): this
  • on(event: "unlink" | "unlinkDir", listener: function): this
  • on(event: string, listener: function): this
  • on(event: "add" | "addDir" | "change", listener: function): this
  • on(event: "all", listener: function): this
  • on(event: "error", listener: function): this
  • on(event: "raw", listener: function): this
  • on(event: "ready", listener: function): this
  • on(event: "unlink" | "unlinkDir", listener: function): this
  • on(event: string, listener: function): this
  • on(event: "add" | "addDir" | "change", listener: function): this
  • on(event: "all", listener: function): this
  • on(event: "error", listener: function): this
  • on(event: "raw", listener: function): this
  • on(event: "ready", listener: function): this
  • on(event: "unlink" | "unlinkDir", listener: function): this
  • on(event: string, listener: function): this
  • on(event: "add" | "addDir" | "change", listener: function): this
  • on(event: "all", listener: function): this
  • on(event: "error", listener: function): this
  • on(event: "raw", listener: function): this
  • on(event: "ready", listener: function): this
  • on(event: "unlink" | "unlinkDir", listener: function): this
  • on(event: string, listener: function): this
  • Parameters

    • event: "add" | "addDir" | "change"
    • listener: function
        • (path: string, stats?: Stats): void
        • Parameters

          • path: string
          • Optional stats: Stats

          Returns void

    Returns this

  • Parameters

    • event: "all"
    • listener: function
        • (eventName: "add" | "addDir" | "change" | "unlink" | "unlinkDir", path: string, stats?: Stats): void
        • Parameters

          • eventName: "add" | "addDir" | "change" | "unlink" | "unlinkDir"
          • path: string
          • Optional stats: Stats

          Returns void

    Returns this

  • Error occured

    Parameters

    • event: "error"
    • listener: function
        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns this

  • Exposes the native Node fs.FSWatcher events

    Parameters

    • event: "raw"
    • listener: function
        • (eventName: string, path: string, details: any): void
        • Parameters

          • eventName: string
          • path: string
          • details: any

          Returns void

    Returns this

  • Fires when the initial scan is complete

    Parameters

    • event: "ready"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "unlink" | "unlinkDir"
    • listener: function
        • (path: string): void
        • Parameters

          • path: string

          Returns void

    Returns this

  • Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "add" | "addDir" | "change"
    • listener: function
        • (path: string, stats?: Stats): void
        • Parameters

          • path: string
          • Optional stats: Stats

          Returns void

    Returns this

  • Parameters

    • event: "all"
    • listener: function
        • (eventName: "add" | "addDir" | "change" | "unlink" | "unlinkDir", path: string, stats?: Stats): void
        • Parameters

          • eventName: "add" | "addDir" | "change" | "unlink" | "unlinkDir"
          • path: string
          • Optional stats: Stats

          Returns void

    Returns this

  • Error occured

    Parameters

    • event: "error"
    • listener: function
        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns this

  • Exposes the native Node fs.FSWatcher events

    Parameters

    • event: "raw"
    • listener: function
        • (eventName: string, path: string, details: any): void
        • Parameters

          • eventName: string
          • path: string
          • details: any

          Returns void

    Returns this

  • Fires when the initial scan is complete

    Parameters

    • event: "ready"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "unlink" | "unlinkDir"
    • listener: function
        • (path: string): void
        • Parameters

          • path: string

          Returns void

    Returns this

  • Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "add" | "addDir" | "change"
    • listener: function
        • (path: string, stats?: Stats): void
        • Parameters

          • path: string
          • Optional stats: Stats

          Returns void

    Returns this

  • Parameters

    • event: "all"
    • listener: function
        • (eventName: "add" | "addDir" | "change" | "unlink" | "unlinkDir", path: string, stats?: Stats): void
        • Parameters

          • eventName: "add" | "addDir" | "change" | "unlink" | "unlinkDir"
          • path: string
          • Optional stats: Stats

          Returns void

    Returns this

  • Error occured

    Parameters

    • event: "error"
    • listener: function
        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns this

  • Exposes the native Node fs.FSWatcher events

    Parameters

    • event: "raw"
    • listener: function
        • (eventName: string, path: string, details: any): void
        • Parameters

          • eventName: string
          • path: string
          • details: any

          Returns void

    Returns this

  • Fires when the initial scan is complete

    Parameters

    • event: "ready"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "unlink" | "unlinkDir"
    • listener: function
        • (path: string): void
        • Parameters

          • path: string

          Returns void

    Returns this

  • Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "add" | "addDir" | "change"
    • listener: function
        • (path: string, stats?: Stats): void
        • Parameters

          • path: string
          • Optional stats: Stats

          Returns void

    Returns this

  • Parameters

    • event: "all"
    • listener: function
        • (eventName: "add" | "addDir" | "change" | "unlink" | "unlinkDir", path: string, stats?: Stats): void
        • Parameters

          • eventName: "add" | "addDir" | "change" | "unlink" | "unlinkDir"
          • path: string
          • Optional stats: Stats

          Returns void

    Returns this

  • Error occured

    Parameters

    • event: "error"
    • listener: function
        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns this

  • Exposes the native Node fs.FSWatcher events

    Parameters

    • event: "raw"
    • listener: function
        • (eventName: string, path: string, details: any): void
        • Parameters

          • eventName: string
          • path: string
          • details: any

          Returns void

    Returns this

  • Fires when the initial scan is complete

    Parameters

    • event: "ready"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "unlink" | "unlinkDir"
    • listener: function
        • (path: string): void
        • Parameters

          • path: string

          Returns void

    Returns this

  • Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "add" | "addDir" | "change"
    • listener: function
        • (path: string, stats?: Stats): void
        • Parameters

          • path: string
          • Optional stats: Stats

          Returns void

    Returns this

  • Parameters

    • event: "all"
    • listener: function
        • (eventName: "add" | "addDir" | "change" | "unlink" | "unlinkDir", path: string, stats?: Stats): void
        • Parameters

          • eventName: "add" | "addDir" | "change" | "unlink" | "unlinkDir"
          • path: string
          • Optional stats: Stats

          Returns void

    Returns this

  • Error occured

    Parameters

    • event: "error"
    • listener: function
        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns this

  • Exposes the native Node fs.FSWatcher events

    Parameters

    • event: "raw"
    • listener: function
        • (eventName: string, path: string, details: any): void
        • Parameters

          • eventName: string
          • path: string
          • details: any

          Returns void

    Returns this

  • Fires when the initial scan is complete

    Parameters

    • event: "ready"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "unlink" | "unlinkDir"
    • listener: function
        • (path: string): void
        • Parameters

          • path: string

          Returns void

    Returns this

  • Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "add" | "addDir" | "change"
    • listener: function
        • (path: string, stats?: Stats): void
        • Parameters

          • path: string
          • Optional stats: Stats

          Returns void

    Returns this

  • Parameters

    • event: "all"
    • listener: function
        • (eventName: "add" | "addDir" | "change" | "unlink" | "unlinkDir", path: string, stats?: Stats): void
        • Parameters

          • eventName: "add" | "addDir" | "change" | "unlink" | "unlinkDir"
          • path: string
          • Optional stats: Stats

          Returns void

    Returns this

  • Error occured

    Parameters

    • event: "error"
    • listener: function
        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns this

  • Exposes the native Node fs.FSWatcher events

    Parameters

    • event: "raw"
    • listener: function
        • (eventName: string, path: string, details: any): void
        • Parameters

          • eventName: string
          • path: string
          • details: any

          Returns void

    Returns this

  • Fires when the initial scan is complete

    Parameters

    • event: "ready"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "unlink" | "unlinkDir"
    • listener: function
        • (path: string): void
        • Parameters

          • path: string

          Returns void

    Returns this

  • Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "add" | "addDir" | "change"
    • listener: function
        • (path: string, stats?: Stats): void
        • Parameters

          • path: string
          • Optional stats: Stats

          Returns void

    Returns this

  • Parameters

    • event: "all"
    • listener: function
        • (eventName: "add" | "addDir" | "change" | "unlink" | "unlinkDir", path: string, stats?: Stats): void
        • Parameters

          • eventName: "add" | "addDir" | "change" | "unlink" | "unlinkDir"
          • path: string
          • Optional stats: Stats

          Returns void

    Returns this

  • Error occured

    Parameters

    • event: "error"
    • listener: function
        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns this

  • Exposes the native Node fs.FSWatcher events

    Parameters

    • event: "raw"
    • listener: function
        • (eventName: string, path: string, details: any): void
        • Parameters

          • eventName: string
          • path: string
          • details: any

          Returns void

    Returns this

  • Fires when the initial scan is complete

    Parameters

    • event: "ready"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "unlink" | "unlinkDir"
    • listener: function
        • (path: string): void
        • Parameters

          • path: string

          Returns void

    Returns this

  • Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

unwatch

  • unwatch(paths: string | string[]): void
  • unwatch(paths: string | string[]): void
  • unwatch(paths: string | string[]): void
  • unwatch(paths: string | string[]): void
  • unwatch(paths: string | string[]): void
  • unwatch(paths: string | string[]): void
  • unwatch(paths: string | string[]): void
  • Stop watching files, directories, or glob patterns. Takes an array of strings or just one string.

    Parameters

    • paths: string | string[]

    Returns void

  • Stop watching files, directories, or glob patterns. Takes an array of strings or just one string.

    Parameters

    • paths: string | string[]

    Returns void

  • Stop watching files, directories, or glob patterns. Takes an array of strings or just one string.

    Parameters

    • paths: string | string[]

    Returns void

  • Stop watching files, directories, or glob patterns. Takes an array of strings or just one string.

    Parameters

    • paths: string | string[]

    Returns void

  • Stop watching files, directories, or glob patterns. Takes an array of strings or just one string.

    Parameters

    • paths: string | string[]

    Returns void

  • Stop watching files, directories, or glob patterns. Takes an array of strings or just one string.

    Parameters

    • paths: string | string[]

    Returns void

  • Stop watching files, directories, or glob patterns. Takes an array of strings or just one string.

    Parameters

    • paths: string | string[]

    Returns void

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method