WARNING: The [sjs-3] engine was deprecated, use [sjs-4] instead. See sjs-4: root.


Return the root file.


file.root() File file.root(cross bool) File


cross bool (default false)

Cross filesystem boundaries. Getting the root file from within an imported filesystem returns the root file of the imported filesystem, unless crossing is enabled, in which case it returns the highest root.


Return the root file of the filesystem which the referenced file is part of.


Basic example.

Cross filesystem boundaries. Note that in this playground, we can not import remote filesystems, thus we can not show the difference here of using the cross argument.

Subscribe to our newsletter!