PageSourceSearch

https://gulpjs.com/assets/js/78aed9ad.9114b757.js

js gulpjs.com collected 2026-09-24 07:27:58 UTC 21,217 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkgulpjs_github_io=self.webpackChunkgulpjs_github_io||[]).push([[970],{7822:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>l,default:()=>o,frontMatter:()=>r,metadata:()=>d,toc:()=>h});var n=s(4848),i=s(8453);const r={id:"watch",title:"watch()",hide_title:!0,sidebar_label:"watch()"},l="watch()",d={id:"api/watch",title:"watch()",description:"Allows watching globs and running a task when a change occurs. Tasks are handled uniformly with the rest of the task system.",source:"@site/docs/api/watch.md",sourceDirName:"api",slug:"/api/watch",permalink:"/docs/en/api/watch",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{id:"watch",title:"watch()",hide_title:!0,sidebar_label:"watch()"},sidebar:"docs",previous:{title:"parallel()",permalink:"/docs/en/api/parallel"},next:{title:"task()",permalink:"/docs/en/api/task"}},c={},h=[{value:"Usage",id:"usage",level:2},{value:"Signature",id:"signature",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Returns",id:"returns",level:3},{value:"Errors",id:"errors",level:3},{value:"Options",id:"options",level:3},{value:"Chokidar instance",id:"chokidar-instance",level:2}];function a(e){const t={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"watch",children:"watch()"}),"\n",(0,n.jsx)(t.p,{children:"Allows watching globs and running a task when a change occurs. Tasks are handled uniformly with the rest of the task system."}),"\n",(0,n.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"const { watch } = require('gulp');\n\nwatch(['input/*.js', '!input/something.js'], function(cb) {\n  // body omitted\n  cb();\n});\n"})}),"\n",(0,n.jsx)(t.h2,{id:"signature",children:"Signature"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"watch(globs, [options], [task])\n"})}),"\n",(0,n.jsx)(t.h3,{id:"parameters",children:"Parameters"}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{style:{textAlign:"center"},children:"parameter"}),(0,n.jsx)(t.th,{style:{textAlign:"center"},children:"type"}),(0,n.jsx)(t.th,{children:"note"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsxs)(t.td,{style:{textAlign:"center"},children:["globs",(0,n.jsx)("br",{}),(0,n.jsx)(t.strong,{children:"(required)"})]}),(0,n.jsxs)(t.td,{style:{textAlign:"center"},children:["string",(0,n.jsx)("br",{}),"array"]}),(0,n.jsxs)(t.td,{children:[(0,n.jsx)(t.a,{href:"/docs/en/api/concepts#globs",children:"Globs"})," to watch on the file system."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"options"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"object"}),(0,n.jsxs)(t.td,{children:["Detailed in ",(0,n.jsx)(t.a,{href:"#options",children:"Options"})," below."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"task"}),(0,n.jsxs)(t.td,{style:{textAlign:"center"},children:["function",(0,n.jsx)("br",{}),"string"]}),(0,n.jsxs)(t.td,{children:["A ",(0,n.jsx)(t.a,{href:"/docs/en/api/concepts#tasks",children:"task function"})," or composed task - generated by ",(0,n.jsx)(t.code,{children:"series()"})," and ",(0,n.jsx)(t.code,{children:"parallel()"}),"."]})]})]})]}),"\n",(0,n.jsx)(t.h3,{id:"returns",children:"Returns"}),"\n",(0,n.jsxs)(t.p,{children:["An instance of ",(0,n.jsx)(t.a,{href:"#chokidar-instance",children:"chokidar"})," for fine-grained control over your watch setup."]}),"\n",(0,n.jsx)(t.h3,{id:"errors",children:"Errors"}),"\n",(0,n.jsxs)(t.p,{children:["When a non-string or array with any non-strings is passed as ",(0,n.jsx)(t.code,{children:"globs"}),', throws an error with the message, "Non-string provided as watch path".']}),"\n",(0,n.jsxs)(t.p,{children:["When a string or array is passed as ",(0,n.jsx)(t.code,{children:"task"}),', throws an error with the message, "watch task has to be a function (optionally generated by using gulp.parallel or gulp.series)".']}),"\n",(0,n.jsx)(t.h3,{id:"options",children:"Options"}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{style:{textAlign:"center"},children:"name"}),(0,n.jsx)(t.th,{style:{textAlign:"center"},children:"type"}),(0,n.jsx)(t.th,{children:"default"}),(0,n.jsx)(t.th,{children:"note"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"ignoreInitial"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"boolean"}),(0,n.jsx)(t.td,{children:"true"}),(0,n.jsxs)(t.td,{children:["If false, the task is called during instantiation as file paths are discovered. Use to trigger the task during startup.",(0,n.jsx)("br",{}),(0,n.jsx)(t.strong,{children:"Note:"})," This option is passed to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"})," but is defaulted to ",(0,n.jsx)(t.code,{children:"true"})," instead of ",(0,n.jsx)(t.code,{children:"false"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"delay"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"number"}),(0,n.jsx)(t.td,{children:"200"}),(0,n.jsx)(t.td,{children:"The millisecond delay between a file change and task execution. Allows for waiting on many changes before executing a task, e.g. find-and-replace on many files."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"queue"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"boolean"}),(0,n.jsx)(t.td,{children:"true"}),(0,n.jsx)(t.td,{children:"When true and the task is already running, any file changes will queue a single task execution. Keeps long running tasks from overlapping."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"events"}),(0,n.jsxs)(t.td,{style:{textAlign:"center"},children:["string",(0,n.jsx)("br",{}),"array"]}),(0,n.jsxs)(t.td,{children:["[ 'add',",(0,n.jsx)("br",{}),"'change',",(0,n.jsx)("br",{}),"'unlink' ]"]}),(0,n.jsxs)(t.td,{children:["The events being watched to trigger task execution. Can be ",(0,n.jsx)(t.code,{children:"'add'"}),", ",(0,n.jsx)(t.code,{children:"'addDir'"}),", ",(0,n.jsx)(t.code,{children:"'change'"}),", ",(0,n.jsx)(t.code,{children:"'unlink'"}),", ",(0,n.jsx)(t.code,{children:"'unlinkDir'"}),", ",(0,n.jsx)(t.code,{children:"'ready'"}),", and/or ",(0,n.jsx)(t.code,{children:"'error'"}),". Additionally ",(0,n.jsx)(t.code,{children:"'all'"})," is available, which represents all events other than ",(0,n.jsx)(t.code,{children:"'ready'"})," and ",(0,n.jsx)(t.code,{children:"'error'"}),".",(0,n.jsx)("br",{}),(0,n.jsxs)(t.em,{children:["This option is passed directly to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),"."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"persistent"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"boolean"}),(0,n.jsx)(t.td,{children:"true"}),(0,n.jsxs)(t.td,{children:["If false, the watcher will not keep the Node process running. Disabling this option is not recommended.",(0,n.jsx)("br",{}),(0,n.jsxs)(t.em,{children:["This option is passed directly to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),"."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"ignored"}),(0,n.jsxs)(t.td,{style:{textAlign:"center"},children:["array",(0,n.jsx)("br",{}),"string",(0,n.jsx)("br",{}),"RegExp",(0,n.jsx)("br",{}),"function"]}),(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["Defines globs to be ignored. If a function is provided, it will be called twice per path - once with just the path, then with the path and the ",(0,n.jsx)(t.code,{children:"fs.Stats"})," object of that file.",(0,n.jsx)("br",{}),(0,n.jsxs)(t.em,{children:["This option is passed directly to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),"."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"followSymlinks"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"boolean"}),(0,n.jsx)(t.td,{children:"true"}),(0,n.jsxs)(t.td,{children:["When true, changes to both symbolic links and the linked files trigger events. If false, only changes to the symbolic links trigger events.",(0,n.jsx)("br",{}),(0,n.jsxs)(t.em,{children:["This option is passed directly to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),"."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"cwd"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"string"}),(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["The directory that will be combined with any relative path to form an absolute path. Is ignored for absolute paths. Use to avoid combining ",(0,n.jsx)(t.code,{children:"globs"})," with ",(0,n.jsx)(t.code,{children:"path.join()"}),".",(0,n.jsx)("br",{}),(0,n.jsxs)(t.em,{children:["This option is passed directly to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),"."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"disableGlobbing"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"boolean"}),(0,n.jsx)(t.td,{children:"false"}),(0,n.jsxs)(t.td,{children:["If true, all ",(0,n.jsx)(t.code,{children:"globs"})," are treated as literal path names, even if they have special characters.",(0,n.jsx)("br",{}),(0,n.jsxs)(t.em,{children:["This option is passed directly to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),"."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"usePolling"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"boolean"}),(0,n.jsx)(t.td,{children:"false"}),(0,n.jsxs)(t.td,{children:["When false, the watcher will use ",(0,n.jsx)(t.code,{children:"fs.watch()"})," (or ",(0,n.jsx)(t.a,{href:"https://github.com/strongloop/fsevents",children:"fsevents"})," on Mac) for watching. If true, use ",(0,n.jsx)(t.code,{children:"fs.watchFile()"})," polling instead - needed for successfully watching files over a network or other non-standard situations. Overrides the ",(0,n.jsx)(t.code,{children:"useFsEvents"})," default.",(0,n.jsx)("br",{}),(0,n.jsxs)(t.em,{children:["This option is passed directly to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),"."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"interval"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"number"}),(0,n.jsx)(t.td,{children:"100"}),(0,n.jsxs)(t.td,{children:["Combine with ",(0,n.jsx)(t.code,{children:"usePolling: true"}),". Interval of file system polling.",(0,n.jsx)("br",{}),(0,n.jsxs)(t.em,{children:["This option is passed directly to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),"."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"binaryInterval"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"number"}),(0,n.jsx)(t.td,{children:"300"}),(0,n.jsxs)(t.td,{children:["Combine with ",(0,n.jsx)(t.code,{children:"usePolling: true"}),". Interval of file system polling for binary files.",(0,n.jsx)("br",{}),(0,n.jsxs)(t.em,{children:["This option is passed directly to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),"."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"useFsEvents"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"boolean"}),(0,n.jsx)(t.td,{children:"true"}),(0,n.jsxs)(t.td,{children:["When true, uses fsevents for watching if available. If explicitly set to true, supersedes the ",(0,n.jsx)(t.code,{children:"usePolling"})," option. If set to false, automatically sets ",(0,n.jsx)(t.code,{children:"usePolling"})," to true.",(0,n.jsx)("br",{}),(0,n.jsxs)(t.em,{children:["This option is passed directly to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),"."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"alwaysStat"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"boolean"}),(0,n.jsx)(t.td,{children:"false"}),(0,n.jsxs)(t.td,{children:["If true, always calls ",(0,n.jsx)(t.code,{children:"fs.stat()"})," on changed files - will slow down file watcher. The ",(0,n.jsx)(t.code,{children:"fs.Stat"})," object is only available if you are using the chokidar instance directly.",(0,n.jsx)("br",{}),(0,n.jsxs)(t.em,{children:["This option is passed directly to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),"."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"depth"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"number"}),(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["Indicates how many nested levels of directories will be watched.",(0,n.jsx)("br",{}),(0,n.jsxs)(t.em,{children:["This option is passed directly to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),"."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"awaitWriteFinish"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"boolean"}),(0,n.jsx)(t.td,{children:"false"}),(0,n.jsxs)(t.td,{children:["Do not use this option, use ",(0,n.jsx)(t.code,{children:"delay"})," instead.",(0,n.jsx)("br",{}),(0,n.jsxs)(t.em,{children:["This option is passed directly to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),"."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"ignorePermissionErrors"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"boolean"}),(0,n.jsx)(t.td,{children:"false"}),(0,n.jsxs)(t.td,{children:["Set to true to watch files that don't have read permissions. The
1n, if watching fails due to EPERM or EACCES errors, they will be skipped silently.",(0,n.jsx)("br",{}),(0,n.jsxs)(t.em,{children:["This option is passed directly to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),"."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"atomic"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"number"}),(0,n.jsx)(t.td,{children:"100"}),(0,n.jsxs)(t.td,{children:["Only active if ",(0,n.jsx)(t.code,{children:"useFsEvents"})," and ",(0,n.jsx)(t.code,{children:"usePolling"}),' are false. Automatically filters out artifacts that occur from "atomic writes" by some editors. If a file is re-added within the specified milliseconds of being deleted, a change event - instead of unlink then add - will be emitted.',(0,n.jsx)("br",{}),(0,n.jsxs)(t.em,{children:["This option is passed directly to ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),"."]})]})]})]})]}),"\n",(0,n.jsx)(t.h2,{id:"chokidar-instance",children:"Chokidar instance"}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.code,{children:"watch()"})," method returns the underlying instance of ",(0,n.jsx)(t.a,{href:"https://github.com/paulmillr/chokidar",children:"chokidar"}),", providing fine-grained control over your watch setup. Most commonly used to register individual event handlers that provide the ",(0,n.jsx)(t.code,{children:"path"})," or ",(0,n.jsx)(t.code,{children:"stats"})," of the changed files."]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"When using the chokidar instance directly, you will not have access to the task system integrations, including async completion, queueing, and delay."})}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"const { watch } = require('gulp');\n\nconst watcher = watch(['input/*.js']);\n\nwatcher.on('change', function(path, stats) {\n  console.log(`File ${path} was changed`);\n});\n\nwatcher.on('add', function(path, stats) {\n  console.log(`File ${path} was added`);\n});\n\nwatcher.on('unlink', function(path, stats) {\n  console.log(`File ${path} was removed`);\n});\n\nwatcher.close();\n"})}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.code,{children:"watcher.on(eventName, eventHandler)"})}),"\n",(0,n.jsxs)(t.p,{children:["Registers ",(0,n.jsx)(t.code,{children:"eventHandler"})," functions to be called when the specified event occurs."]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{style:{textAlign:"center"},children:"parameter"}),(0,n.jsx)(t.th,{style:{textAlign:"center"},children:"type"}),(0,n.jsx)(t.th,{children:"note"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"eventName"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"string"}),(0,n.jsxs)(t.td,{children:["The events that may be watched are ",(0,n.jsx)(t.code,{children:"'add'"}),", ",(0,n.jsx)(t.code,{children:"'addDir'"}),", ",(0,n.jsx)(t.code,{children:"'change'"}),", ",(0,n.jsx)(t.code,{children:"'unlink'"}),", ",(0,n.jsx)(t.code,{children:"'unlinkDir'"}),", ",(0,n.jsx)(t.code,{children:"'ready'"}),", ",(0,n.jsx)(t.code,{children:"'error'"}),", or ",(0,n.jsx)(t.code,{children:"'all'"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"eventHandler"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"function"}),(0,n.jsx)(t.td,{children:"Function to be called when the specified event occurs. Arguments detailed in the table below."})]})]})]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{style:{textAlign:"center"},children:"argument"}),(0,n.jsx)(t.th,{style:{textAlign:"center"},children:"type"}),(0,n.jsx)(t.th,{children:"note"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"path"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"string"}),(0,n.jsxs)(t.td,{children:["The path of the file that changed. If the ",(0,n.jsx)(t.code,{children:"cwd"})," option was set, the path will be made relative by removing the ",(0,n.jsx)(t.code,{children:"cwd"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"stats"}),(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"object"}),(0,n.jsxs)(t.td,{children:["An ",(0,n.jsx)(t.a,{href:"/docs/en/api/concepts#file-system-stats",children:"fs.Stat"})," object, but could be ",(0,n.jsx)(t.code,{children:"undefined"}),". If the ",(0,n.jsx)(t.code,{children:"alwaysStat"})," option was set to ",(0,n.jsx)(t.code,{children:"true"}),", ",(0,n.jsx)(t.code,{children:"stats"})," will always be provided."]})]})]})]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.code,{children:"watcher.close()"})}),"\n",(0,n.jsx)(t.p,{children:"Shuts down the file watcher. Once shut down, no more events will be emitted."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.code,{children:"watcher.add(globs)"})}),"\n",(0,n.jsx)(t.p,{children:"Adds additional globs to an already-running watcher instance."}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{style:{textAlign:"center"},children:"parameter"}),(0,n.jsx)(t.th,{style:{textAlign:"center"},children:"type"}),(0,n.jsx)(t.th,{children:"note"})]})}),(0,n.jsx)(t.tbody,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"globs"}),(0,n.jsxs)(t.td,{style:{textAlign:"center"},children:["string",(0,n.jsx)("br",{}),"array"]}),(0,n.jsx)(t.td,{children:"The additional globs to be watched."})]})})]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.code,{children:"watcher.unwatch(globs)"})}),"\n",(0,n.jsx)(t.p,{children:"Removes globs that are being watched, while the watcher continues with the remaining paths."}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{style:{textAlign:"center"},children:"parameter"}),(0,n.jsx)(t.th,{style:{textAlign:"center"},children:"type"}),(0,n.jsx)(t.th,{children:"note"})]})}),(0,n.jsx)(t.tbody,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"center"},children:"globs"}),(0,n.jsxs)(t.td,{style:{textAlign:"center"},children:["string",(0,n.jsx)("br",{}),"array"]}),(0,n.jsx)(t.td,{children:"The globs to be removed."})]})})]})]})}function o(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>l,x:()=>d});var n=s(6540);const i={},r=n.createContext(i);function l(e){const t=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),n.createElement(r.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.