FS

Date

2/1/2024 - 2:44:47 AM

Export

Constructors

Properties

_items: FSItems
_uuidToItem: Record<string, FSItemUUID>
api: API
cloud: Cloud
itemsMutex: ISemaphore = ...
mkdirMutex: ISemaphore = ...
mutex: ISemaphore = ...
sdkConfig: FilenSDKConfig
socket: Socket = ...

Methods

  • Add an item to the internal item tree.

    Parameters

    • param0: {
          item: FSItem;
          path: string;
      }

    Returns Promise<void>

    Async

  • Private

    Attach listeners for relevant realtime events.

    Parameters

    • Optional connect: boolean

    Returns Promise<void>

    Async

  • Remove an item from the internal item tree.

    Parameters

    • param0: {
          path: string;
      }
      • path: string

    Returns Promise<void>

    Async

  • Private

    Deletes file/directoy at path.

    Parameters

    • param0: {
          path: string;
          permanent?: boolean;
          type?: FSItemType;
      }
      • path: string
      • Optional permanent?: boolean
      • Optional type?: FSItemType

    Returns Promise<void>

    Date

    2/28/2024 - 4:57:19 PM

    Async

  • Alias of cp.

    Parameters

    • Rest ...params: [{
          abortSignal?: AbortSignal;
          from: string;
          onProgress?: ProgressCallback;
          onProgressId?: string;
          pauseSignal?: PauseSignal;
          to: string;
      }]

    Returns Promise<void>

    Date

    2/14/2024 - 5:07:27 AM

    Async

  • Copy a file or directory structure. Recursively creates intermediate directories if needed. Warning: Can be really inefficient when copying large directory structures. All files need to be downloaded first and then reuploaded due to our end to end encryption. Plain copying unfortunately does not work. Only available in a Node.JS environment.

    Parameters

    • param0: {
          abortSignal?: AbortSignal;
          from: string;
          onProgress?: ProgressCallback;
          onProgressId?: string;
          pauseSignal?: PauseSignal;
          to: string;
      }
      • Optional abortSignal?: AbortSignal
      • from: string
      • Optional onProgress?: ProgressCallback
      • Optional onProgressId?: string
      • Optional pauseSignal?: PauseSignal
      • to: string

    Returns Promise<void>

    Async

  • Download a file or directory from path to a local destination path. Only available in a Node.JS environment.

    Parameters

    • param0: {
          abortSignal?: AbortSignal;
          destination: string;
          onProgress?: ProgressCallback;
          onProgressId?: string;
          path: string;
          pauseSignal?: PauseSignal;
      }
      • Optional abortSignal?: AbortSignal
      • destination: string
      • Optional onProgress?: ProgressCallback
      • Optional onProgressId?: string
      • path: string
      • Optional pauseSignal?: PauseSignal

    Returns Promise<void>

    Async

  • Alias of readdir.

    Parameters

    • Rest ...params: [{
          path: string;
          recursive?: boolean;
      }]

    Returns Promise<string[]>

    Date

    2/13/2024 - 8:48:40 PM

    Async

  • Alias of stat.

    Parameters

    • Rest ...params: [{
          path: string;
      }]

    Returns Promise<FSStats>

    Date

    2/13/2024 - 8:49:18 PM

    Async

  • Creates a directory at path. Recursively creates intermediate directories if they don't exist.

    Parameters

    • param0: {
          path: string;
      }
      • path: string

    Returns Promise<string>

    Date

    2/14/2024 - 1:34:11 AM

    Async

  • Private

    Normalizes a path to be used with FS.

    Parameters

    • param0: {
          path: string;
      }
      • path: string

    Returns string

    Date

    2/14/2024 - 12:50:52 AM

  • Parameters

    • __namedParameters: {
          path: string;
          type?: FSItemType;
      }

    Returns Promise<null | string>

  • Read a file. Returns buffer of given length, at position and offset. Memory efficient to read only a small part of a file.

    Parameters

    • param0: {
          abortSignal?: AbortSignal;
          length?: number;
          offset?: number;
          onProgress?: ProgressCallback;
          onProgressId?: string;
          path: string;
          pauseSignal?: PauseSignal;
          position?: number;
      }
      • Optional abortSignal?: AbortSignal
      • Optional length?: number
      • Optional offset?: number
      • Optional onProgress?: ProgressCallback
      • Optional onProgressId?: string
      • path: string
      • Optional pauseSignal?: PauseSignal
      • Optional position?: number

    Returns Promise<Buffer>

    Async

  • Read a file at path. Warning: This reads the whole file into memory and can be pretty inefficient.

    Parameters

    • param0: {
          abortSignal?: AbortSignal;
          onProgress?: ProgressCallback;
          onProgressId?: string;
          path: string;
          pauseSignal?: PauseSignal;
      }
      • Optional abortSignal?: AbortSignal
      • Optional onProgress?: ProgressCallback
      • Optional onProgressId?: string
      • path: string
      • Optional pauseSignal?: PauseSignal

    Returns Promise<Buffer>

    Async

  • List files and directories at path.

    Parameters

    • param0: {
          path: string;
          recursive?: boolean;
      }
      • path: string
      • Optional recursive?: boolean

    Returns Promise<string[]>

    Date

    2/20/2024 - 2:40:03 AM

    Async

  • Rename or move a file/directory. Recursively creates intermediate directories if needed.

    Parameters

    • param0: {
          from: string;
          to: string;
      }
      • from: string
      • to: string

    Returns Promise<void>

    Date

    2/14/2024 - 1:39:32 AM

    Async

  • Alias of unlink.

    Parameters

    • param0: {
          path: string;
          permanent?: boolean;
      }
      • path: string
      • Optional permanent?: boolean

    Returns Promise<void>

    Date

    2/28/2024 - 4:58:30 PM

    Async

  • Deletes directory at path.

    Parameters

    • Rest ...params: [{
          path: string;
          permanent?: boolean;
      }]

    Returns Promise<void>

    Date

    2/14/2024 - 2:53:48 AM

    Async

  • Deletes a file at path.

    Parameters

    • Rest ...params: [{
          path: string;
          permanent?: boolean;
      }]

    Returns Promise<void>

    Async

  • Deletes file/directory at path.

    Parameters

    • param0: {
          path: string;
          permanent?: boolean;
      }
      • path: string
      • Optional permanent?: boolean

    Returns Promise<void>

    Date

    2/28/2024 - 4:58:37 PM

    Async

  • Upload file or directory to path from a local source path. Recursively creates intermediate directories if needed. Only available in a Node.JS environment.

    Parameters

    • param0: {
          abortSignal?: AbortSignal;
          onProgress?: ProgressCallback;
          onProgressId?: string;
          overwriteDirectory?: boolean;
          path: string;
          pauseSignal?: PauseSignal;
          source: string;
      }
      • Optional abortSignal?: AbortSignal
      • Optional onProgress?: ProgressCallback
      • Optional onProgressId?: string
      • Optional overwriteDirectory?: boolean
      • path: string
      • Optional pauseSignal?: PauseSignal
      • source: string

    Returns Promise<CloudItem>

    Async

  • Private

    Wait for an API key (login) to become available

    Returns Promise<string>

    Async

  • Alias of writeFile.

    Parameters

    • Rest ...params: [{
          abortSignal?: AbortSignal;
          content: Buffer;
          onProgress?: ProgressCallback;
          onProgressId?: string;
          path: string;
          pauseSignal?: PauseSignal;
      }]

    Returns Promise<CloudItem>

    Date

    2/20/2024 - 9:45:40 PM

    Async

  • Write to a file. Warning: This reads the whole file into memory and can be very inefficient. Only available in a Node.JS environment.

    Parameters

    • param0: {
          abortSignal?: AbortSignal;
          content: Buffer;
          onProgress?: ProgressCallback;
          onProgressId?: string;
          path: string;
          pauseSignal?: PauseSignal;
      }

    Returns Promise<CloudItem>

    Async

Generated using TypeDoc