Origami.

files(...keys)

Concatenates the given keys and treats them as a path to a folder or file.

  • A folder will be returned as a FileMap
  • A file will be returned as a Uint8Array (if the path does not end in a trailing slash) or as unpacked data; see File paths.

Because the Origami language recognizes many types of paths, you won’t often need to explicitly invoke the Origami.files command. It is primarily useful when you have a string path and want to obtain the file or folder at that location.

Example: a YAML data file contains a path to a profile picture:

# user.yaml
name: Alice
profile: users/photos/alice.jpeg

Given that arrangement, you can load the indicated profile picture with:

Origami.files(user.yaml/profile)

See also Origami.projectRoot, which returns a reference to your project’s root folder.