{"id":16890178,"url":"https://github.com/marak/bpipe","last_synced_at":"2025-03-17T06:31:44.778Z","repository":{"id":21233589,"uuid":"24548887","full_name":"Marak/bpipe","owner":"Marak","description":"Browser \u003c==\u003e Unix Pipes","archived":false,"fork":false,"pushed_at":"2014-10-07T14:13:56.000Z","size":923,"stargazers_count":157,"open_issues_count":4,"forks_count":4,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-29T11:13:28.486Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/Marak.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":"2014-09-28T03:16:21.000Z","updated_at":"2024-10-16T02:04:46.000Z","dependencies_parsed_at":"2022-07-27T02:17:02.893Z","dependency_job_id":null,"html_url":"https://github.com/Marak/bpipe","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marak%2Fbpipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marak%2Fbpipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marak%2Fbpipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marak%2Fbpipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Marak","download_url":"https://codeload.github.com/Marak/bpipe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243847062,"owners_count":20357317,"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-13T17:01:02.179Z","updated_at":"2025-03-17T06:31:44.205Z","avatar_url":"https://github.com/Marak.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bpipe\n\n## Browser \u003c==\u003e Unix Pipes\n\n## `v0.0.1`\n\n`bpipe` is a command line tool which allows you to create readable and writable streams between standard Unix Pipes and the browser to run commands like this:\n\n```bash\nbpipe -s \"#myInput\" -e \"keyup\" | less\necho \"hello there\" | bpipe -s \"#myDiv\"\n````\n\n# Update\n\nSince this project has been receiving a good amount attention I have cleaned up the codebase and started development of version `v0.2.0` at https://github.com/marak/bpipe/tree/v0.2.0\n\n# Installation\n\n```bash\nnpm install bpipe -g\n```\n\n# Usage\n\n```\n  Usage: bpipe [server] [options]\n\n  server: the location of the `bpipe-server` to connect to\n          Defaults to localhost:8001\n\n  Options:\n\n    -h, --help               output usage information\n    -V, --version            output the version number\n    -s, --selector [string]  the CSS selector to attach to\n    -e, --event [string]     the DOM event to attach to\n    -u, --url [string]       the url to connect to\n\n```\n\n\n# Examples\n\nA hosted `bpipe-server` service is available at [http://bpipe.io](http://bpipe.io). This allows the use of `bpipe` without needing to setup a server.\n\nYou can also run a local server using the following command:\n\n```bash\nbpipe-server\nopen index.html\n```\n\n## STDIN\n\n### Pipe data from a text `\u003cinput\u003e` to `less`\n\n```bash\nbpipe -s \"#myInput\" -e \"keyup\" | less\n```\n\n*Whenever the select box is changed in the browser, the new value will be piped to less*\n\n\u003cimg src=\"https://github.com/Marak/bpipe/raw/master/screenshots/pipe-text-input-to-less.gif\"/\u003e\n\n\n### Pipe data from a `\u003cselect\u003e` box to `less`\n\n```bash\nbpipe -s \"#mySelect\" -e \"change\" | less\n```\n\n*Whenever the select box is changed in the browser, the new value will be piped to less*\n\n\u003cimg src=\"https://github.com/Marak/bpipe/raw/master/screenshots/pipe-select-box-to-less.gif\"/\u003e\n\n\n\n## STDOUT\n\n### Pipe data from `echo` to a div's innerHTML\n  \n```bash\necho \"hello there\" | bpipe -s \"#myDiv\"\n```\n\n*When this command is run the browser will update with \"hello there\"*\n\n\u003cimg src=\"https://github.com/Marak/bpipe/raw/master/screenshots/pipe-echo-to-div.gif\"/\u003e\n\n\n### Caveats\n\n`bpipe` will only work if the custom `.js` file is loaded on the page you wish to interact with. You will also need to run a websocket server to facilitate communication between the browser and `bpipe`. A server and browser bundle are both included in this project. A free `bpipe` service is also available at [http://bpipe.io](http://bpipe.io)\n\nIn the not so distant future perhaps browsers will natively support this type of interaction. Until then, we polyfill.\n\n### Can I actually use `tail`?\n\nOf course! You can use any standard Unix tool. If you want to use `tail` it should work by creating a temporary file or named piped.\n`less` also works pretty well.\n\n```bash\nbpipe -s \"#mySelect\" -e \"change\" \u003e /tmp/select.log\ntail -f /tmp/select.log\n```\n\n### Open Ownership / Open Contribution\n\nIf anyone is interested in contributing to the project I would be glad to add additional contributors / owners. \n\n## Status\n\nThe current build is functional, but should be considered experimental. With a little more polish, `bpipe` could be a useful tool. If anyone wants to help further develop this tool feel free to reach out or start opening up pull requests.\n\n## TODO\n\n* Better querySelectorAll support\n - binding complex query statements\n - using selectors that contain more than one match\n* Add ability to open new pages with one line\n - `echo \"*Hello\" | marked | bpipe index.html`\n* Unit tests\n - The library needs unit tests.\n* Better configuration options for `bpipe` and `bpipe-server`\n - Allow `bpipe` and `bpipe-server` to specify host and port\n - Create `.bpipe` configuration file\n* Implement WebRTC communication to bypass having to pass data through server\n\n### Dependencies / Acknowledgements\n\n- [websocket-stream](https://github.com/maxogden/websocket-stream) by @maxodgen\n- [domnode-dom](https://github.com/chrisdickinson/domnode-dom) by @chrisdickinson\n- [ws](https://github.com/einaros/ws) by @einaros\n- [Dominic Tarr](https://github.com/dominictarr/)\n\n## License\nMIT\n\na","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarak%2Fbpipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarak%2Fbpipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarak%2Fbpipe/lists"}