{"id":19418982,"url":"https://github.com/playform/pipe","last_synced_at":"2025-07-14T12:35:50.468Z","repository":{"id":186868150,"uuid":"675916938","full_name":"PlayForm/Pipe","owner":"PlayForm","description":"Pipe 🧪","archived":false,"fork":false,"pushed_at":"2025-07-10T01:09:55.000Z","size":3088,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"Current","last_synced_at":"2025-07-10T04:24:31.489Z","etag":null,"topics":["file","files","javascript","pipe","playform","processing","typescript"],"latest_commit_sha":null,"homepage":"https://NPMJS.Org/@playform/pipe","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PlayForm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null},"funding":{"custom":"https://Stripe.PlayForm.Cloud/b/3csdQZfzn2LDaBOcMN","open_collective":"playform-cloud-collective"}},"created_at":"2023-08-08T03:09:48.000Z","updated_at":"2025-07-10T01:09:58.000Z","dependencies_parsed_at":"2023-10-03T04:08:40.071Z","dependency_job_id":"c56a089f-ed4b-44d2-8077-b2ba5d960568","html_url":"https://github.com/PlayForm/Pipe","commit_stats":null,"previous_names":["baxast/files-pipe","nikolarhristov/files-pipe","nikolarhristov/filespipe","playform/filespipe","playform/filepipe","playform/pipe"],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/PlayForm/Pipe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlayForm%2FPipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlayForm%2FPipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlayForm%2FPipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlayForm%2FPipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PlayForm","download_url":"https://codeload.github.com/PlayForm/Pipe/tar.gz/refs/heads/Current","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlayForm%2FPipe/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264555347,"owners_count":23627322,"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":["file","files","javascript","pipe","playform","processing","typescript"],"created_at":"2024-11-10T13:15:47.079Z","updated_at":"2025-07-14T12:35:50.425Z","avatar_url":"https://github.com/PlayForm.png","language":"TypeScript","readme":"# 🧪 [Pipe]\n\n`Pipe` allows you to process files in a pipeline, making it easy to perform\nvarious operations on them.\n\n### Installation 🚀\n\nTo get started with `Pipe`, follow these steps:\n\nInstall the `Pipe` package using `npm`:\n\n```sh\nnpm install -D -E @playform/pipe\n```\n\nCreate a new `Pipe` instance:\n\n**`Main.ts`**\n\n```ts\nawait new (await import(\"@playform/pipe\")).default().In(\"./Input\");\n```\n\n### Getting started\n\nWith `Pipe`, you can use the `Pipe` method to perform operations on files within\nthe pipe. Here's an example of how to do it with some file writes:\n\n**`Main.ts`**\n\n```ts\nawait(\n\tawait(\n\t\tawait new (await import(\"@playform/pipe\")).default().In(\"./Input\"),\n\t).By(\"**/*.md\"),\n).Pipe({\n\t// Append some content to all of the text files\n\tWrote: (On) =\u003e (On.Buffer += \"LICENSE [MIT]\"),\n});\n```\n\n### Default Callbacks\n\n`Pipe` provides default callbacks for file processing. These callbacks can be\ncustomized to suit your specific needs. Here are the default callbacks:\n\n```ts\nawait new (await import(\"@playform/pipe\")).default().Pipe({\n\t// Read the file into a buffer\n\tRead: async ({ Input }) =\u003e await fs.promises.readFile(Input, \"utf-8\"),\n\n\t// Wrote the buffer into a file\n\tWrote: async ({ Buffer }) =\u003e Buffer,\n\n\t// Passed the file through a check\n\tPassed: async (On) =\u003e On \u0026\u0026 true,\n\n\t// Failed processing the file\n\tFailed: async ({ Input }) =\u003e `Error: Cannot process file ${Input}!`,\n\n\t// Accomplished processing the file\n\tAccomplished: async ({ Input, Output }) =\u003e\n\t\t`Processed ${Input} in ${Output}.`,\n\n\t// Fulfilled the whole plan\n\tFulfilled: async ({ File }) =\u003e\n\t\t`Successfully processed a total of ${File} ${\n\t\t\tFile === 1 ? \"file\" : \"files\"\n\t\t}.`,\n\n\t// Changed the plan\n\tChanged: async (Plan) =\u003e Plan,\n});\n```\n\n### Add Multiple Paths\n\nYou can add multiple paths to your pipe by specifying an array as the `Path`\nvariable:\n\n**`Main.ts`**\n\n```ts\nawait new (await import(\"@playform/pipe\")).default().In([\n\t\"./Input\",\n\t\"./Input2\",\n]);\n```\n\n### Input-Output Mapping\n\n`Pipe` will allow you to provide a map of paths for different input and output\ndirectories, making it easy to control where files are read from and written to:\n\n**`Main.ts`**\n\n```ts\nawait new (await import(\"@playform/pipe\")).default().In(\n\tnew Map([[\"./Input\", \"./Output\"]]),\n);\n```\n\n### File Filtering\n\nYou can filter files to exclude specific ones from your `Pipe`. Filters can be\nan array of regular expressions or a single match. You can also use functions to\nmatch on file names:\n\n**`Main.ts`**\n\n```ts\nawait new (await import(\"@playform/pipe\")).default().Not([\n\t\"File.txt\",\n\t(File: string) =\u003e File === \"./Input/File.txt\",\n]);\n```\n\n### Controlling Logging\n\nYou can control the logging level by setting the `Logger` parameter. The default\nvalue is `2`, but you can set it to `0` if you don't want to see debug messages:\n\n**`Main.ts`**\n\n```ts\nnew (await import(\"@playform/pipe\")).default(0);\n```\n\n[Pipe]: HTTPS://NPMJS.Org/@playform/pipe\n\n## Changelog\n\nSee [`CHANGELOG.md`](CHANGELOG.md) for a history of changes to this component.\n","funding_links":["https://Stripe.PlayForm.Cloud/b/3csdQZfzn2LDaBOcMN","https://opencollective.com/playform-cloud-collective"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplayform%2Fpipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplayform%2Fpipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplayform%2Fpipe/lists"}