pkg() function
Reads the running service's own name and version, used to expand the %name and %version placeholders in the logger environment variables.
Signature:
export declare function pkg(): {
name: string;
version: string;
};
Returns:
the service name and version, or the fallback pair
Remarks
Resolved from package.json in the process's CURRENT WORKING DIRECTORY, not from this package's location. A service started from a different directory therefore reports whatever it finds there, and one started somewhere with no package.json falls back to { name: 'logger', version: '' } rather than failing.
Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.