Skip to content

Environment

The Environment class provides static properties and methods that allow access to various environment-specific information and settings. This includes information about the host, user, file paths, theme preferences, and temporary directories. Additionally, it provides utilities for managing temporary files.

Properties:

  • host: string (read-only)
    The server name/IP we are currently connected to.
  • user: Grantee (read-only)
    Information about the current user.
  • password: string (read-only, string)
    The password associated with the current user.
  • logintoken: string (read-only, string)
    If you need to start another session of Application Center or run Command, passing user name and password as arguments exposes them in the Task Manager. By using logintoken, which is valid for only 1 minute, that security vulnerability is mitigated.
  • isIDE: boolean (read-only)
    Indicates whether the environment is running as Integrated Development Environment (IDE).
  • isDeveloperMode: boolean (read-only)
    A flag indicating if the environment is in developer mode (logged user belongs to Developers group).
  • isDebuggerMode: boolean (read-only)
    A flag indicating if the Application Center is running in debugger mode.
  • VSCode: string (read-only)
    The path to VSCode.exe or Codium.exe on the current PC, if available.
  • language: string (read-only)
    The current language being used in the environment (e.g., "en", "fr"). Current language can be changed using the main menu: Help→Change Language.
    IMPORTANT: If you are a developer (user belonging to Developers group) your language will always be "en" (English) and cannot be changed.
  • languages: { code: string, name: string }[] (read-only)
    An array of available languages in the environment, where each object contains:
  • code: The language code (e.g., "en" for English).
  • name: The full name of the language (e.g., "English").
  • isLightTheme: boolean (read-only)
    Indicates if the light theme is currently active in the environment.
  • isDarkTheme: boolean (read-only)
    Indicates if the dark theme is currently active in the environment.
  • isSystemTheme: boolean (read-only)
    Indicates if the environment is using the system's theme (whether dark or light).
  • rootDir: string (read-only)
    The root directory path of the environment on the local PC. Default is: C:\Users\<USER>\Documents\NodeActa\
    Name 'NodeActa' in this path can be changed by changing the 'Name' property in the server config file server.na.
  • rootAppDir: string (read-only)
    The root directory of the javascript applications on the local PC. Default is: C:\Users\<USER>\Documents\NodeActa\Apps\
    Name 'NodeActa' in this path can be changed by changing the 'Name' property in the server config file server.na.
  • rootClassDir: string (read-only)
    The root directory where class files are stored on the local PC. Default is: C:\Users\<USER>\Documents\NodeActa\Classes\
    Name 'NodeActa' in this path can be changed by changing the 'Name' property in the server config file server.na.
  • dir or scriptDir: string (read-only)
    The directory where the currently executed javascript file is stored on the local PC.
  • path or scriptPath: string (read-only)
    The path of the currently executed javascript is stored on the local PC.
  • tmpdir or tempDirectory: string (read-only)
    The path to the system’s temporary directory.
  • picturesDirectory: string (read-only)
    The path to the system Pictures directory.
  • musicDirectory: string (read-only)
    The path to the system Music directory.
  • videosDirectory: string (read-only)
    The path to the system Videos directory.
  • documentsDirectory: string (read-only)
    The path to the system Documents directory.
  • downloadsDirectory: string (read-only)
    The path to the system Download directory.
  • loggedUsers: Grantee[] (read-only)
    The list of all users currently logged into the system.
    Use System Management→Logged Users app to review all users currently logged to the system and terminate their sessions if needed.
  • lockedRecords: Attribute[] (read-only)
    The list of records that are currently locked in the environment. Each returned Attribute object has the following properties: dataclass, id, lockUser, lockComputer, lockIP, lockTime. When a record is locked by a user, other users cannot modify it. Sometimes, for example when Application Center crashes, some records might remain locked until that session timeouts.
    Use System Management→Locked Records app to review locked records and if necessary unlock them (requires admin rights by default).
  • certificates: Certificate[] (read-only)
    List of all certificates available to logged user. Use System Management→Certificates app to assign certificates to users.

Methods:

  • getTempFile or getTmpFile(ext?: string | ".~tmp"): string
    Generates a unique temporary file path with the specified extension.