`@push.rocks/smartgulp` is a tiny, modern Gulp-style file pipeline for TypeScript and Node.js projects. It gives you the familiar `src(...).pipe(...).pipe(dest(...))` workflow without pulling in the full Gulp task runner: read files by glob, process them as `SmartFile` objects, write them somewhere else, or replace them in place.
Use it when you want stream-based build steps that stay small, explicit, and easy to compose with regular Node streams.
## Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
The files flowing through a `smartgulp` pipeline are `SmartFile` instances from [`@push.rocks/smartfile`](https://www.npmjs.com/package/@push.rocks/smartfile). That means transforms can inspect paths, read or mutate contents, and then pass each file along to the next stream.
`src()` accepts an array of glob patterns. Each matching file is emitted as a `SmartFile`, and `dest()` writes every received file to the target directory.
## Transform Files
Because `smartgulp` uses object-mode streams, you can use any transform that accepts and emits `SmartFile` objects. The companion package [`@push.rocks/gulp-function`](https://www.npmjs.com/package/@push.rocks/gulp-function) is a convenient fit:
Node streams are asynchronous. If your script needs to wait for the final file before exiting or starting the next step, add an end-of-stream transform:
This is useful in tests, build scripts, and one-off automation where the surrounding code needs a promise.
## Glob Behavior
`src()` resolves each provided pattern from the current working directory. It derives the static base directory before the first glob segment, loads that directory, and filters files with `minimatch`.
Examples:
| Pattern | Base directory | Matched portion |
| --- | --- | --- |
| `./src/**/*.ts` | `./src` | `**/*.ts` |
| `./docs/*.md` | `./docs` | `*.md` |
| `./package.json` | `.` | `package.json` |
Dotfiles are included in matching, so patterns can pick up files such as `.config.json` when the glob allows them.
- Run text or metadata transformations across many files.
- Update generated files in place.
- Build small project-specific pipelines without a full task runner.
- Compose `SmartFile`-aware transforms with regular Node stream flow.
## API Reference
### `src(patterns: string[])`
Creates an object-mode `Transform` stream and asynchronously pushes every matching `SmartFile` into it. The stream ends after all matched files have been pushed.
### `dest(directory: string)`
Creates an object-mode writable stream. Each incoming `SmartFile` is written to `directory` through `SmartFile.writeToDir()`.
### `replace()`
Creates an object-mode writable stream. Each incoming `SmartFile` is persisted through `SmartFile.write()`.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.