darkyen / bfs-process

An emulation of NodeJS's process variable for the browser. Used in BrowserFS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BrowserFS Process v0.1.4

An emulation of NodeJS's process variable. Used in BrowserFS.

Provides only basic process functionality, such as changing directories and stdout/stdin/stderr emulation.

Use with Browserify

You can use bfs-process with Browserify. Just use the following configuration:

{
    insertGlobalVars:
    {
        "process": function () { return "require('bfs-process')" }
    }
}

stdin/stdout/stderr

To avoid circular dependencies between process and readable-stream, process exposes a process.initializeTTY() function that creates the stdout/stdin/stderr properties. By default, process will initialize these variables on the next event loop after process is defined.

If this is not soon enough for your application, simply call process.initializeTTY() from your code to force it to happen sooner.

About

An emulation of NodeJS's process variable for the browser. Used in BrowserFS.

License:MIT License


Languages

Language:TypeScript 93.9%Language:JavaScript 6.1%