Skip to content

Async standard console input & output (STDIN, STDOUT) for React PHP

License

Notifications You must be signed in to change notification settings

clue-labs/reactphp-stdio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clue/stdio-react Build Status

Async standard console input & output (STDIN, STDOUT) for React PHP

Note: This project is in early alpha stage! Feel free to report any issues you encounter.

Quickstart example

Once installed, you can use the following code to present a prompt in a CLI program:

$stdio = new Stdio($loop);
$stdio->getReadline()->setPrompt('Input > ');

$stdio->on('line', function ($line) use ($stdio) {
    var_dump($line);
    
    if ($line === 'quit') {
        $stdio->end();
    }
});

See also the examples.

Install

The recommended way to install this library is through composer. New to composer?

{
    "require": {
        "clue/stdio-react": "dev-master"
    }
}

License

MIT

About

Async standard console input & output (STDIN, STDOUT) for React PHP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%