Download src/ink/hooks/use-stdout.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 385 Bytes
-
https://huggingface.co/chenbhao/codev/resolve/main/src/ink/hooks/use-stdout.ts
- Command line
-
hf download hf://chenbhao/codev/src/ink/hooks/use-stdout.ts
-
curl -L -o use-stdout.ts https://huggingface.co/chenbhao/codev/resolve/main/src/ink/hooks/use-stdout.ts
385 Bytes
| import { useContext } from 'react' | |
| import StdoutContext from '../components/StdoutContext.js' | |
| /** | |
| * A React hook that returns the stdout stream where Ink renders your app, | |
| * plus a `write` function for emitting raw data to stdout outside of Ink's | |
| * normal render loop (e.g. for inline image protocols). | |
| */ | |
| export default function useStdout() { | |
| return useContext(StdoutContext) | |
| } | |