Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

createDirectory

  • createDirectory(path: string): void
  • Create a directory if it doesn't already exist. If it already exists, nothing happens.

    Parameters

    • path: string

      SphereFS path of the directory to create.

    Returns void

deleteFile

  • deleteFile(path: string): void
  • Delete a file from the file system. The SphereFS prefix must be writable.

    Parameters

    • path: string

      SphereFS path of the file to delete.

    Returns void

directoryExists

  • directoryExists(path: string): boolean
  • Get a Boolean value indicating whether a directory exists.

    Parameters

    • path: string

      SphereFS path of the directory to check for existence.

    Returns boolean

directoryOf

  • directoryOf(path: string): string
  • Get the directory component of a path, stripping the filename if present.

    Parameters

    • path: string

      SphereFS or relative path of a file or directory. It doesn't need to exist.

    Returns string

evaluateScript

  • evaluateScript(path: string): void
  • Evaluate a JavaScript script file (.js) as traditional code (not as a module).

    Parameters

    • path: string

      SphereFS path of the script file to execute.

    Returns void

extensionOf

  • extensionOf(path: string): string | null
  • Get the filename extension (everything after the last .) from a file path.

    throws

    {TypeError} path must not name a known directory or end in a slash.

    Parameters

    • path: string

      SphereFS or relative path of a file. The file need not exist.

    Returns string | null

    The extension starting with the last ., or null if the path has no extension.

fileExists

  • fileExists(path: string): boolean
  • Get a Boolean value indicating whether a file exists.

    Parameters

    • path: string

      SphereFS path of the file to check for existence.

    Returns boolean

fileNameOf

  • fileNameOf(path: string): string | undefined
  • Get the filename component from a file path, stripping any directory information if present.

    Parameters

    • path: string

      SphereFS or relative path of a file. The file need not exist.

    Returns string | undefined

    The filename component of the path, or undefined if the path names a known directory and/or ends in a slash.

fullPath

  • fullPath(filename: string, baseDirectory?: string): string
  • Get the full, canonical SphereFS path of a given path or filename.

    Parameters

    • filename: string

      The filename or path to be interpreted.

    • Optional baseDirectory: string

      SphereFS path of the base directory (used to resolve relative paths).

    Returns string

readFile

  • readFile(path: string): string

relativePath

  • relativePath(path: string, baseDirectory: string): string
  • Get an abbreviated version of a full SphereFS path by finding its path relative to a given base directory.

    Parameters

    • path: string

      A full SphereFS path to be abbreviated.

    • baseDirectory: string

      SphereFS path of the base directory for the relative path.

    Returns string

removeDirectory

  • removeDirectory(directoryPath: string): void
  • Remove an empty directory from the file system. The SphereFS prefix must be writable.

    Parameters

    • directoryPath: string

      SphereFS path of the directory to remove.

    Returns void

rename

  • rename(path: string, newPath: string): void
  • Rename a file or directory or move it to a new location. The source and target prefixes must be writable.

    Parameters

    • path: string

      SphereFS path of the file to rename or move.

    • newPath: string

      The new SphereFS path of the file.

    Returns void

writeFile

  • writeFile(path: string, content: string | string[] | ArrayBuffer | ArrayBufferView): void
  • Parameters

    • path: string
    • content: string | string[] | ArrayBuffer | ArrayBufferView

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc