Plugin to add node evaluation and repl to terminal-in-react
npm i -S terminal-in-react-node-eval-plugin
yarn add terminal-in-react-node-eval-plugin
The plugin requires a file system plugin to work currently terminal-in-react-pseudo-file-system-plugin
is the only one available. You have
to pass the name of the file system plugin as a config option.
import NodeEvalPlugin from 'terminal-in-react-node-eval-plugin';
import pseudoFileSystemPlugin from 'terminal-in-react-pseudo-file-system-plugin';
const FileSystemPlugin = pseudoFileSystemPlugin();
...
<Terminal
plugins={[
FileSystemPlugin,
{
class: NodeEvalPlugin,
config: {
filesystem: FileSystemPlugin.displayName
}
}
]}
/>
...
The commands it adds are:
node
The methods available to other plugins
node
- Eval files
- Node repl
- Eval node requires
- Run as process (web workers)