{"id":21507683,"url":"https://github.com/jadesrochers/streams","last_synced_at":"2025-03-17T14:44:48.249Z","repository":{"id":34304236,"uuid":"175869668","full_name":"jadesrochers/streams","owner":"jadesrochers","description":"Stream wrapper to allow creation of streams with just a function passed to define its operation.","archived":false,"fork":false,"pushed_at":"2023-04-16T14:06:08.000Z","size":417,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-25T08:05:17.051Z","etag":null,"topics":["dataprocessing","stream"],"latest_commit_sha":null,"homepage":null,"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/jadesrochers.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}},"created_at":"2019-03-15T18:08:49.000Z","updated_at":"2023-04-16T14:06:13.000Z","dependencies_parsed_at":"2023-01-15T06:09:36.445Z","dependency_job_id":null,"html_url":"https://github.com/jadesrochers/streams","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadesrochers%2Fstreams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadesrochers%2Fstreams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadesrochers%2Fstreams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadesrochers%2Fstreams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jadesrochers","download_url":"https://codeload.github.com/jadesrochers/streams/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244053897,"owners_count":20390443,"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":["dataprocessing","stream"],"created_at":"2024-11-23T20:37:50.970Z","updated_at":"2025-03-17T14:44:48.221Z","avatar_url":"https://github.com/jadesrochers.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Streams\nMakes it easy to use various types of streams by giving a simple interfacing  \nand allowing specification of their actions by passing a function.\n\n## Whats the Use?\nUse several types of streams (transform, read, write, counter) with minimal\nconfiguration or syntax. Just need input and functions to define\ntransformations and output.\n\n## installation \nnpm install @jadesrochers/streams  \nconst streams = require('@jadesrochers/streams')  \n\n## Usage\nFour stream types are provided; read, transform, count, and write.  \nThe count stream is just a custom transform stream for tracking  \nhow many object passed through the stream.\n\n#### Set up transform and write functions.\n```javascript\nlet transfcn = n =\u003e (parseInt(n) + 1)\nlet writefcn = n =\u003e console.log(n) \n```\n\n#### Create the stream objects, demonstrating all of them here.\n```javascript\nlet reader = streams.fileStream('./testfile.txt') \nlet transform = streams.transformStream(transfcn) \nlet counter = streams.countStream(10, ' stream objects') \nlet writer = streams.writeStream(writefcn) \n```\n\n##### Using the split library so that the test file is broken into lines.\n```javascript\nconst split = require('split2');\n```\n\n#### Create the test file\ntestfile.txt; put it in the directory you will run node from.\n\u003e  10  \n\u003e  20  \n\u003e  30  \n\u003e  40  \n\u003e  50  \n\u003e  60  \n\u003e  70  \n\u003e  80  \n\u003e  90  \n\u003e  100  \n\u003e  110  \n\u003e  120  \n\u003e  130  \n\u003e  140  \n\u003e  150  \n\u003e  160  \n\u003e  170  \n\u003e  180  \n\u003e  190  \n\u003e  200  \n\n\n### Read the data and run it through the streams\n```javascript\nreader.pipe(split()).pipe(transform).pipe(counter).pipe(writer).on('finish', () =\u003e { console.log('Stream complete, closed'); process.exit(0)}).on('error',  () =\u003e console.log('Somthing went wrong'))\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjadesrochers%2Fstreams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjadesrochers%2Fstreams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjadesrochers%2Fstreams/lists"}