{"id":13447299,"url":"https://github.com/floatdrop/gulp-watch","last_synced_at":"2025-05-14T16:14:23.002Z","repository":{"id":13341975,"uuid":"16029103","full_name":"floatdrop/gulp-watch","owner":"floatdrop","description":"Watch, that actually is an endless stream","archived":false,"fork":false,"pushed_at":"2023-04-24T14:38:03.000Z","size":2312,"stargazers_count":641,"open_issues_count":70,"forks_count":100,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-06T18:08:45.320Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/floatdrop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-01-18T16:28:57.000Z","updated_at":"2025-03-06T01:41:52.000Z","dependencies_parsed_at":"2024-06-18T11:26:06.755Z","dependency_job_id":null,"html_url":"https://github.com/floatdrop/gulp-watch","commit_stats":{"total_commits":257,"total_committers":34,"mean_commits":"7.5588235294117645","dds":0.3151750972762646,"last_synced_commit":"39e30a2bc5eb229229bf8cbbebbd6d77c5e34025"},"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fgulp-watch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fgulp-watch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fgulp-watch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fgulp-watch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/floatdrop","download_url":"https://codeload.github.com/floatdrop/gulp-watch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248775206,"owners_count":21159567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T05:01:13.269Z","updated_at":"2025-04-13T20:19:02.500Z","avatar_url":"https://github.com/floatdrop.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# [gulp](https://github.com/gulpjs/gulp)-watch [![Build Status: Linux][travis-image]][travis-url] [![Build Status: Windows][appveyor-image]][appveyor-url] [![Dependency Status][depstat-image]][depstat-url]\n\nFile watcher that uses super-fast [chokidar](https://github.com/paulmillr/chokidar) and emits vinyl objects.\n\n## Installation\n\n```\nnpm install --save-dev gulp-watch\n```\n\n## Usage\n\n```js\nvar gulp = require('gulp'),\n    watch = require('gulp-watch');\n\ngulp.task('stream', function () {\n\t// Endless stream mode\n    return watch('css/**/*.css', { ignoreInitial: false })\n        .pipe(gulp.dest('build'));\n});\n\ngulp.task('callback', function () {\n\t// Callback mode, useful if any plugin in the pipeline depends on the `end`/`flush` event\n    return watch('css/**/*.css', function () {\n        gulp.src('css/**/*.css')\n            .pipe(gulp.dest('build'));\n    });\n});\n```\n\n\u003e __Protip:__ until gulpjs 4.0 is released, you can use [gulp-plumber](https://github.com/floatdrop/gulp-plumber) to prevent stops on errors.\n\nMore examples can be found in [`docs/readme.md`](/docs/readme.md).\n\n## API\n\n### watch(glob, [options, callback])\n\nCreates a watcher that will spy on files that are matched by `glob` which can be a\nglob string or array of glob strings.\n\nReturns a pass through stream that will emit vinyl files\n(with additional `event` property) that corresponds to event on file-system.\n\n#### Callback `function(vinyl)`\n\nThis function is called when events happen on the file-system.\nAll incoming files that are piped in are grouped and passed to the `events` stream as is.\n\n * `vinyl` — is [vinyl](https://github.com/wearefractal/vinyl) object that corresponds to the file that caused the event. Additional `event` field is added to determine what caused changes.\n\nPossible events:\n\n * `add` - file was added to watch or created\n * `change` - file was changed\n * `unlink` - file was deleted\n\n#### Options\n\nThis object is passed to the [`chokidar` options](https://github.com/paulmillr/chokidar#api) directly. Options for [`gulp.src`](https://github.com/gulpjs/gulp/blob/master/docs/API.md#options) are also available. If you do not want content from `watch`, then add `read: false` to the `options` object.\n\n#### options.[ignoreInitial](https://github.com/paulmillr/chokidar#path-filtering)\nType: `Boolean`  \nDefault: `true`\n\n\u003e Indicates whether chokidar should ignore the initial add events or not.\n\n#### options.events\nType: `Array`  \nDefault: `['add', 'change', 'unlink']`\n\nList of events, that should be watched by gulp-watch. Contains [event names from chokidar](https://github.com/paulmillr/chokidar#events).\n\n#### options.base\nType: `String`  \nDefault: `undefined`\n\nUse explicit base path for files from `glob`. Read more about `base` and `cwd` in [gulpjs docs](https://github.com/gulpjs/gulp/blob/master/docs/API.md#options).\n\n#### options.name\nType: `String`  \nDefault: `undefined`\n\nName of the watcher. If it is present in options, you will get more readable output.\n\n#### options.verbose\nType: `Boolean`  \nDefault: `false`\n\nThis option will enable verbose output.\n\n#### options.readDelay\nType: `Number`  \nDefault: `10`\n\nWait for `readDelay` milliseconds before reading the file.\n\n#### options.read\nType: `Boolean`  \nDefault: `true`\n\nSetting this to `false` will return `file.contents` as null and not read the file at all. Most useful as an optimization if your plugins pipeline doesn't make use of the file contents (e.g. `gulp-clean`), or to avoid reading the file twice if you use `gulp.src()` inside the callback instead of the file object that is passed as argument.\n\n### Methods\n\nReturned `Stream` from constructor has some useful methods:\n\n * `add(path / paths)`\n * `unwatch(path / paths)`\n * `close()`\n\n### Events\n\nAll events from [chokidar](http://npmjs.com/chokidar):\n\n * `add`, `change`, `unlink`, `addDir`, `unlinkDir`, `error`, `ready`, `raw`\n\n\n### [Changelog](https://github.com/floatdrop/gulp-watch/releases)\n\n## License\n\nMIT (c) 2014 Vsevolod Strukchinsky (floatdrop@gmail.com)\n\n[npm-url]: https://npmjs.org/package/gulp-watch\n[npm-image]: http://img.shields.io/npm/v/gulp-watch.svg?style=flat\n\n[travis-url]: https://travis-ci.org/floatdrop/gulp-watch\n[travis-image]: http://img.shields.io/travis/floatdrop/gulp-watch.svg?style=flat\n\n[appveyor-url]: https://ci.appveyor.com/project/floatdrop/gulp-watch/branch/master\n[appveyor-image]: https://ci.appveyor.com/api/projects/status/gmjwsqmxht1m131s/branch/master?svg=true\n\n[depstat-url]: https://david-dm.org/floatdrop/gulp-watch\n[depstat-image]: http://img.shields.io/david/floatdrop/gulp-watch.svg?style=flat\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatdrop%2Fgulp-watch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloatdrop%2Fgulp-watch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatdrop%2Fgulp-watch/lists"}