{"id":13599491,"url":"https://github.com/plasma-umass/browsix","last_synced_at":"2025-06-10T21:18:11.111Z","repository":{"id":4133514,"uuid":"51937144","full_name":"plasma-umass/browsix","owner":"plasma-umass","description":"Browsix is a Unix-like operating system for the browser. ","archived":false,"fork":false,"pushed_at":"2022-03-27T22:12:32.000Z","size":19727,"stargazers_count":3183,"open_issues_count":49,"forks_count":184,"subscribers_count":78,"default_branch":"master","last_synced_at":"2025-06-10T10:57:25.347Z","etag":null,"topics":["browserfs","javascript-framework","unix-like"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plasma-umass.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":"2016-02-17T16:29:16.000Z","updated_at":"2025-06-03T07:33:42.000Z","dependencies_parsed_at":"2022-08-06T15:00:37.748Z","dependency_job_id":null,"html_url":"https://github.com/plasma-umass/browsix","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plasma-umass%2Fbrowsix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plasma-umass%2Fbrowsix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plasma-umass%2Fbrowsix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plasma-umass%2Fbrowsix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plasma-umass","download_url":"https://codeload.github.com/plasma-umass/browsix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plasma-umass%2Fbrowsix/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259152777,"owners_count":22813225,"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":["browserfs","javascript-framework","unix-like"],"created_at":"2024-08-01T17:01:05.133Z","updated_at":"2025-06-10T21:18:11.078Z","avatar_url":"https://github.com/plasma-umass.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"Browsix - Bringing Unix to the Browser\n======================================\n\n[![NPM version](https://badge.fury.io/js/browsix.svg)](http://badge.fury.io/js/browsix)\n[![david-dm-status-badge](https://david-dm.org/plasma-umass/browsix.svg)](https://david-dm.org/jvilk/browserfs#info=dependencies\u0026view=table)\n[![david-dm-status-badge](https://david-dm.org/plasma-umass/browsix/dev-status.svg)](https://david-dm.org/plasma-umass/browsix#info=devDependencies\u0026view=table)\n\nWhile standard operating systems like Unix make it relatively simple\nto build complex applications, web browsers lack the features that\nmake this possible.  This project is Browsix, a JavaScript-only\nframework that brings the essence of Unix to the browser. Browsix\nmakes core Unix features available to web applications (including\npipes, processes, signals, sockets, and a shared file system) and\nextends JavaScript runtimes for C, C++, Go, and Node.js programs so\nthey can run in a Unix-like environment within the browser. Browsix\nalso provides a POSIX-like shell that makes it easy to compose\napplications together for parallel data processing via pipes.\n\n*For more details, check out our [tech\nreport (PDF)](https://web.cs.umass.edu/publication/details.php?id=2414)*.\n\n\nAnother way to think about this is that modern web applications are\nmulti-process by nature - the client and some of the application logic\nlives in the browser, and some of it lives in the cloud, often\nimplemented as\n[microservices](https://en.wikipedia.org/wiki/Microservices).\n\nBrowsix lets you rethink the boundary between code executing in the\nbrowser vs. server-side, while taking advantage of the multi-core\nnature of modern computing devices.\n\nBrowsix enables you to compose the in-browser part of your web\napplications out of processes.  Processes behave as you would expect\ncoming from [Unix](https://en.wikipedia.org/wiki/Unix): they run in\nparallel with the main browser thread, can communicate over pipes,\nsockets, or the filesystem, and can create subprocesses.  This process\nmodel is implemented on top of existing browser APIs, like [web\nworkers](https://en.wikipedia.org/wiki/Web_worker), so it works in all\nmodern browsers.  Browsix applications can be served statically or\nover a [CDN](https://en.wikipedia.org/wiki/Content_delivery_network).\n\n### The Browsix Shell\n\nAs a proof of concept, we've implemented a POSIX-like shell on top of\nBrowsix, along with an implementation of a number of standard Unix\nutilities (`cat`, `tee`, `echo`, `sha1sum`, and friends).  The\nutilities are all standard node programs that will run directly under\nnode, or in the browser under Browsix.  Individual commands are\nexecuted in their own workers, and piping works as expected:\n\n![shell](doc/img/shell.png)\n\nTry it out here: [live demo!](https://unix.bpowers.net/)\n\n### Meme creator\n\nBrowsix is useful for more than web terminals.  With Browsix, you can\nrun Go microservices directly in the browser!  As an example, we have\nimplemented a meme creator, that lets you create memes (sometimes\nknown as image macros) with (hopefully) humorous text on top of\nseveral images.  We wrote this as a standard REST service in Go,\naccepting the text and image type as parameters, and returning a PNG.\nWe used [our modified\nGopherJS](https://github.com/bpowers/browsix-gopherjs) compiler to\ncompile the Go service (including all dependencies, such as the\nTrueType font renderer and image manipulation libraries) to\nJavaScript, and Browsix to run this JavaScript as a process in a\nbackground Web Worker.  We then dynamically route requests to either\nthis in-browser server or a remote server depending on user agent and\nnetwork connectivity.\n\n\u003cdiv style=\"text-align:center\"\u003e\u003cimg src=\"doc/meme_screenshot.png\" width=\"423\"\u003e\u003c/div\u003e\n\n### Details\n\nBrowsix currently supports running node.js, Go, and C/C++ programs.\nIt supports Go with a [modified GopherJS\ncompiler](https://github.com/bpowers/browsix-gopherjs) (requires a\nhost [Go 1.6 install for\nnow](https://github.com/bpowers/browsix-gopherjs/issues/2)), and C/C++\nwith [modifications to\nEmscripten](https://github.com/bpowers/emscripten/tree/_browsix).\n\n### Browsix-SPEC\n\nBrowsix supports executing SPEC CPU2006 and SPEC CPU2017 benchmarks using Browsix-SPEC\ninterface. \n\nUsing Browsix\n-------------\n\nThere are two parts to Browsix: build tooling (the modified Go + C\ncompilers) and runtime support (the kernel + Browsix APIs).\n\nGet browsix through npm:\n\n```\n    $ npm install --save browsix\n```\n\n\nBuilding \u0026 Testing\n------------------\n\nBrowsix requires **nodejs 4.3.0** or later, which is more recent than\nthe version packaged in Ubuntu Wiley.  To get a recent version of\nnode, follow the instructions on the [node.js\nwebsite](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions).\nIf you don't know whether you should choose node 4.x or 5.x, choose\n4.x (it is the long-term support branch).\n\nBrowsix has three other dependencies: `git`, `npm` (usually installed\nalong with node), and `make`, and builds on OSX and Linux systems.\nOnce you have those dependencies:\n\n```\n    $ git clone --recursive https://github.com/plasma-umass/browsix\n    $ cd browsix\n    $ make test-once serve\n```\n\nThis will pull the dependencies, build the runtime and all the\nutilities, run a number of tests in either Firefox or Chrome, and then\nlaunch a copy of the shell served locally.\n\n`Dockerfile`\n-----------\n\n```sh\n$ ./docker/build.sh\n....\nroot@3695ed0cdf45:~/browsix# make test-once serve\n  TEST\n[13:07:00] Using gulpfile ~/browsix/gulpfile.js\n[13:07:00] Starting 'copy-node-kernel'...\n[13:07:00] Starting 'copy-node'...\n[13:07:00] Starting 'lint-kernel'...\n[13:07:00] Starting 'lint-browser-node'...\n[13:07:00] Starting 'lint-bin'...\n[13:07:00] Starting 'lint-syscall-api'...\n[13:07:00] Finished 'copy-node-kernel' after 82 ms\n[13:07:02] Finished 'lint-syscall-api' after 1.61 s\n[13:07:04] Finished 'lint-kernel' after 3.72 s\n[13:07:05] Finished 'lint-browser-node' after 4.46 s\n[13:07:05] Finished 'lint-bin' after 5.08 s\n[13:07:05] Starting 'build-bin'...\n[13:07:06] Finished 'copy-node' after 5.16 s\n[13:07:06] Starting 'build-kernel'...\n[13:07:06] Starting 'build-browser-node'...\n...\n```\n\nBuilding and using Browsix-SPEC\n-------------------------------\nAfter building Browsix, build Browsix-SPEC through make:\n```\nmake browsix-spec\n```\nFollow the instructions in browsix-spec.md.\n\nIn-browser node limitations\n---------------------------\n\nBrowsix's `browser-node` implementation has an important to understand\nlimitation: **you must explicitly call `process.exit()`**.  Without\nthis, utilities will work under real-node, but appear to hang under\n`browser-node`.  This is not an intrinsic limitation, but it is a\nhairy implementation detail -- node exits when the event loop is\nempty, and there are no active timers or network callbacks.  For us to\ndo the same thing means we need to hook `setTimeout` and any other\nfunctions that take callbacks to ensure we don't exit early.\n\n\nDocumentation\n-------------\n\nFor a high-level overview of the system design and architecture,\nplease see [this document](doc/report.pdf).\n\n\nContributing\n------------\n\nYou're interested in contributing?  That's great!\n\nThe process is similar to other open-source projects hosted on github:\n\n* Fork the repository\n* Make some changes\n* Commit your changes with a descriptive commit message\n* Open a pull request\n\n\nContact\n-------\n\nIf you have questions or problems, please [open an\nissue](https://github.com/plasma-umass/browsix/issues) on this\nrepository (plasma-umass/browsix).\n\n\nOpen Source\n-----------\n\nThis project is licensed under the MIT license, but also incorporates\ncode from other sources.\n\nBrowsix uses [BrowserFS](https://github.com/jvilk/BrowserFS) for its\nfilesystem, which is [primarily MIT licensed](LICENSE.browserfs).\n\nbrowser-node's [`nextTick`](src/browser-node/browser-node.ts#L114)\nimplementation comes from the\n[acorn](https://github.com/ternjs/acorn) project, released under [the\nMIT license](LICENSE.acorn).\n\nA large portion of browser-node is the\n[node](https://github.com/nodejs/node) standard library, which is [MIT\nlicensed](LICENSE.node).\n\nFunctions to convert buffers to utf-8 strings and back are derivative\nof\n[browserify](https://github.com/substack/node-browserify/blob/master/LICENSE)\nimplementations (ported to TypeScript), [MIT\nlicensed](LICENSE.browserify) as well.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplasma-umass%2Fbrowsix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplasma-umass%2Fbrowsix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplasma-umass%2Fbrowsix/lists"}