Skip to main content
Module

x/enzastdlib/os/linux.ts>getUserData

enzastdlib is a set of TypeScript modules that follow a common design API philosophy aiming at sane defaults and ease-of-use targeting the Deno TypeScript runtime.
Latest
variable getUserData
import { getUserData } from "https://deno.land/x/enzastdlib@v0.0.4/os/linux.ts";

Returns the data directory of the current user.

NOTE: Returns the value of the environment variable XDG_DATA_HOME or $HOME joined with .local/share as a fallback.

Examples

Example 1

import { assertEquals } from 'https://deno.land/std/testing/asserts.ts';
import { getUserData } from 'https://deno.land/x/enzastdlib/os/linux.ts';

assertEquals(
    getUserData(),
    '/home/novacbn/.local/share'
);

type

() => unknown