Packages

object IOUtils

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. IOUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def extension(path: String): Option[String]

    Get an extension on a file or None.

  2. def fexists(path: String): Boolean

    Returns true if the file exists, false otherwise.

    Returns true if the file exists, false otherwise. Synchronous.

  3. def filename(path: String): Option[String]

    Get the filename (base + ext) if it exists.

  4. def fromBase64(s: String): Buffer

    Convert string from base64.

  5. def getPostfix(path: String): Option[String]

    Get the extension/postfix on a filename less the preceeding ".".

  6. def namepart(path: String): Option[String]

    Get the base(name) + extension.

  7. def pathjoin(lhs: String, rhs: String): String

    Join two path segments.

  8. def pprint(o: Dynamic): String

    Pretty print a js.Dynamic object.

  9. def pprint(o: Object, opts: InspectOptions = ...): String

    Pretty print a js.Object

  10. def render(o: Any, opts: InspectOptions = ...): String

    Render a js.Any into a string using nodejs Inspect.

  11. def slurp(file: String, encoding: String = "utf8"): String

    Slurp a file as a utf8 string, synchronous, full read into memory.

  12. def slurpAsBase64(file: String): String

    Slurp a file as a base64 encoded string.

    Slurp a file as a base64 encoded string. Good for json upload bodies. Synchronous

  13. def slurpAsJson[T](file: String, reviver: Option[Reviver] = None, encoding: String = "utf8"): T

    Slurp a file as JSON and cast.

    Slurp a file as JSON and cast. No exception handling is provided. Synchronous.

  14. def writeToFile(path: String, content: |[String, Buffer])(implicit ec: ExecutionContext): IO[Unit]

    Async write content to file creating paths if path contains path segments that do not exist.

    Async write content to file creating paths if path contains path segments that do not exist.

    path

    Path name, both path and file.

    content

    String content.

    returns

    Unit if file written, otherwise a failed IO.

  15. def writeToFileSync(path: String, content: |[String, Buffer]): Unit

    Write to file synchronously.