JanetDocsI'm feeling luckyGithub sign in



    (file/read f what &opt buf)
    Read a number of bytes from a file into a buffer. A buffer can be
    provided as an optional fourth argument, otherwise a new buffer is
    created. 'what' can either be an integer or a keyword. Returns the
    buffer with file contents. Values for 'what':
      :all - read the whole file
      :line - read up to and including the next newline character
      n (integer) - read up to n bytes from the file

1 exampleSign in to add an example
#!/usr/bin/env janet
# echo stdin to stdout.
(file/write stdout (file/read stdin :all))