{"id":19560677,"url":"https://github.com/zoubin/writable-stream-stack","last_synced_at":"2025-08-30T04:10:01.334Z","repository":{"id":32884834,"uuid":"36479239","full_name":"zoubin/writable-stream-stack","owner":"zoubin","description":"make a node stream pipeline, new transforms can be pushed to apply before the data reaches the dest stream","archived":false,"fork":false,"pushed_at":"2015-06-20T01:03:41.000Z","size":148,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T18:13:58.528Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoubin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-29T02:54:34.000Z","updated_at":"2015-09-06T10:09:32.000Z","dependencies_parsed_at":"2022-07-12T19:10:30.251Z","dependency_job_id":null,"html_url":"https://github.com/zoubin/writable-stream-stack","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zoubin/writable-stream-stack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fwritable-stream-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fwritable-stream-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fwritable-stream-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fwritable-stream-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoubin","download_url":"https://codeload.github.com/zoubin/writable-stream-stack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fwritable-stream-stack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272801050,"owners_count":24995209,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-11T05:08:27.327Z","updated_at":"2025-08-30T04:10:01.312Z","avatar_url":"https://github.com/zoubin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# writable-stream-stack\nMake a node stream pipeline. New transforms can be pushed to apply before the data reaches the dest stream\n\n## Usage\n\n```javascript\nvar Stack = require('writable-stream-stack');\n```\n\n### ws = Stack(dest)\n### ws = Stack(tr1, tr2,..., dest)\n### ws = Stack([tr1, tr2,..., dest])\n`ws` is a `Writable` stream, and each chunk written in will reach the writable `dest`, before handled by the transform pipeline `tr1, tr2,...`\n\n### ws.on('done', cb)\n`ws` fires `done` after `dest` has finished.\n\n### ws.push(tr)\nAdd transform `tr` to the very beginning of the pipeline.\n\n### ws.pop()\nDelete the first transform from the pipeline.\n\n## Example\n\n```javascript\nvar fs = require('fs');\nvar vfs = require('vinyl-fs');\nvar path = require('path');\nvar Stack = require('writable-stream-stack');\nvar source = require('vinyl-source-stream');\n\nvar DEST = path.join(__dirname, 'files');\nvar dest = createDestStream('b.js', DEST)\n\nfs.createReadStream(path.join(__dirname, 'files/a.js'))\n    .pipe(dest);\n\ndest.on('done', function () {\n    fs.createReadStream(path.join(DEST, 'b.js'))\n        .pipe(process.stdout);\n});\n\nfunction createDestStream(filename, dir) {\n    return Stack(\n        source(filename),\n        vfs.dest(dir)\n    );\n}\n```\n\na.js:\n\n```javascript\nmodule.exports = function () {\n    console.log('a');\n};\n```\n\noutput:\n\n```\nmodule.exports = function () {\n    console.log('a');\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fwritable-stream-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoubin%2Fwritable-stream-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fwritable-stream-stack/lists"}