Journal reader/watcher.

Reads or watches a journal directory. It implements the AsyncIterable interface so for reading/watching the journal you simply iterate of the instance of this class with a for..of loop for example. If you prefer you can also use the next method to read the next event from the journal until this method returns null to indicate the end of the journal.

In watch mode the iteration does not end and is continued every time a new event is appended to the journal by the game. Watch mode can be stopped by calling the close method. Iteration loops will end when journal is closed.

Implements

Methods

  • Returns async iterator for the journal events.

    Returns AsyncGenerator<AnyJournalEvent, any, unknown>

    Async iterator for the events in this journal.

  • Closes the journal by stopping the watcher (if any) and closing the line reader.

    Returns Promise<void>

  • Returns the journal directory.

    Returns string

    The journal directory.

  • Returns the next event from the journal. When end of journal is reached then in watch mode this method waits until a new event arrives. When not in watch mode or when journal is closed this method returns null when no more events are available.

    Returns Promise<null | AnyJournalEvent>

    The next journal event or null when end is reached.

  • Returns the current backpack inventory read from the Backpack.json file.

    Returns Promise<null | Backpack>

    The current backpack inventory. Null if Backpack.json file does not exist or is not readable.

  • Returns the current cargo data read from the Cargo.json file.

    Returns Promise<null | Backpack>

    The current cargo data. Null if Cargo.json file does not exist or is not readable.

  • Returns the current fleet carrier materials data read from the FCMaterials.json file.

    Returns Promise<null | ExtendedFCMaterials>

    The current fleet carrier materials data. Null if FCMaterials.json file does not exist or is not readable.

  • Returns the current market data read from the Market.json file.

    Returns Promise<null | ExtendedMarket>

    The current market data. Null if Market.json file does not exist or is not readable.

  • Returns the current nav route read from the NavRoute.json file.

    Returns Promise<null | ExtendedNavRoute>

    The current nav route data. Null if NavRoute.json file does not exist or is not readable.

  • Returns the current contents of the ship locker from the ShipLocker.json file.

    Returns Promise<null | ExtendedShipyard>

    The current ship locker content. Null if ShipLocker.json file does not exist or is not readable.

  • Returns the current shipyard data read from the Shipyard.json file.

    Returns Promise<null | ExtendedShipyard>

    The current shipyard data. Null if Shipyard.json file does not exist or is not readable.

  • Returns the current status read from the Status.json file.

    Returns Promise<null | Status>

    The current status. Null if Status.json file does not exist or is not readable.

  • Watches the Backpack.json file for changes and reports any new data. It always reports the current data as first change.

    Returns AsyncGenerator<Backpack, any, unknown>

    Async iterator watching backpack inventory changes.

  • Watches the Cargo.json file for changes and reports any new data. It always reports the current data as first change.

    Returns AsyncGenerator<Backpack, any, unknown>

    Async iterator watching cargo changes.

  • Watches the FCMaterials.json file for changes and reports any new data. It always reports the current data as first change.

    Returns AsyncGenerator<ExtendedFCMaterials, any, unknown>

    Async iterator watching fleet carrier materials data changes.

  • Watches the Market.json file for changes and reports any new data. It always reports the current data as first change.

    Returns AsyncGenerator<ExtendedMarket, any, unknown>

    Async iterator watching market data changes.

  • Watches the ModulesInfo.json file for changes and reports any new data. It always reports the current data as first change.

    Returns AsyncGenerator<ExtendedModuleInfo, any, unknown>

    Async iterator watching modules info changes.

  • Watches the NavRoute.json file for changes and reports any new data. It always reports the current data as first change.

    Returns AsyncGenerator<ExtendedNavRoute, any, unknown>

    Async iterator watching nav route data changes.

  • Watches the Outfitting.json file for changes and reports any new data. It always reports the current data as first change.

    Returns AsyncGenerator<ExtendedOutfitting, any, unknown>

    Async iterator watching outfitting data changes.

  • Watches the ShipLocker.json file for changes and reports any new data. It always reports the current data as first change.

    Returns AsyncGenerator<ExtendedShipyard, any, unknown>

    Async iterator watching ship locker content changes.

  • Watches the Shipyard.json file for changes and reports any new data. It always reports the current data as first change.

    Returns AsyncGenerator<ExtendedShipyard, any, unknown>

    Async iterator watching shipyard data changes.

  • Watches the Status.json file for changes and reports any new status. It always reports the current status as first change.

    Returns AsyncGenerator<Status, any, unknown>

    Async iterator watching status changes.

  • Searches for the journal directory in common spaces. First it checks for existence of directory specified with environment variable ED_JOURNAL_DIR. Then it looks into the standard directory on a windows system and then it checks to standard directory within Proton (for Linux).

    If you know more common journal locations then please let me know so I can improve the search.

    Returns Promise<string>

    The found journal directory.

    Throws

    JournalError - When journal directory was not found.