{"id":16490713,"url":"https://github.com/awinterman/sentinal-stream","last_synced_at":"2026-05-13T15:34:25.515Z","repository":{"id":10371207,"uuid":"12514410","full_name":"AWinterman/sentinal-stream","owner":"AWinterman","description":" A transform stream which segregates a sentinel value into its own 'data' event.","archived":false,"fork":false,"pushed_at":"2014-02-07T22:59:41.000Z","size":148,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-12T07:49:23.508Z","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":"mabhelita/AutomaticHouse","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AWinterman.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":"2013-09-01T02:06:23.000Z","updated_at":"2014-02-07T22:59:42.000Z","dependencies_parsed_at":"2022-09-07T23:31:01.169Z","dependency_job_id":null,"html_url":"https://github.com/AWinterman/sentinal-stream","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/AWinterman%2Fsentinal-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWinterman%2Fsentinal-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWinterman%2Fsentinal-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWinterman%2Fsentinal-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AWinterman","download_url":"https://codeload.github.com/AWinterman/sentinal-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241325882,"owners_count":19944455,"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-10-11T13:48:49.711Z","updated_at":"2025-11-24T15:05:19.340Z","avatar_url":"https://github.com/AWinterman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sentinal-Stream #\n\nA transform stream that finds a sentinal value in a data stream, and then emits it as a seperate data event.\n\n## Application ##\nAny time you want to take a particular action if a certain value appears in a stream, e.g. splitting a stream, stopping a stream early, etc.\n\n## API ##\n\n`sentinal = new Sentinal(sep) ` returns a [transform\nstream](http://nodejs.org/api/stream.html#stream_class_stream_transform).\n`sep` is a buffered string. It will be stored on `sentinal.seperator`.\n\n# Example #\n\n```javascript\nvar Sentinal = require('sentinal-stream')\n  , through = require('through') // npm.im/through\n  , from = require('from') // npm.im/from\n  , sentence = ''\n\nvar periods = new Sentinal(new Buffer('|||'))\n\nvar source = from([\n    '||| is the delimiter.'\n  , ' Sometimes it fits|||'\n  , 'Sometimes it might take'\n  , 'more than one line|||'\n  , 'Look||| two per chunk|||'\n  , '||| or ||| even ||| three!'\n  , 'And sometimes only part ||'\n  , '| Of the separator fits.'\n])\n\nvar gather_wipe = through(function(data) {\n  if(data === periods.seperator) {\n    sentence \u0026\u0026 console.log(sentence + '.')\n    sentence = ''\n    return\n  }\n  sentence += data \n})\n\nsource\n  .pipe(periods)\n  .pipe(gather_wipe) \n\n\n```\nYields:\n\n```\nis the delimiter. Sometimes it fits.\nSometimes it might take more than one line.\nLook. two per chunk.\nor even three! And sometimes only part .\n Of the seperator fits.\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawinterman%2Fsentinal-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawinterman%2Fsentinal-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawinterman%2Fsentinal-stream/lists"}