New Prague, Minnesota

    xdg-env

    0.0.3 • Public • Published

    Node XDG-ENV



    Provide an Object with the XDG_* env variables or their defaults (according to http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html)

    Arrays are the env strings (or defaults) splitted by ':'
    $* means process.env.*

    Install

    npm install xdg-env
    

    Example

    var env = require('xdg-env')
     
    console.log(env)
     
    // logs
     
    {
        DATA_HOME: "/home/user/.local/share",
        
        CONFIG_HOME: "/home/user/.config",
        
        DATA_DIRS: [ // first DATA_DIR is always DATA_HOME
            "/home/user/.local/share",
            "/usr/share/pantheon",
            "/usr/share/gnome",
            "/usr/local/share/",
            "/usr/share/"
        ],
        
        CONFIG_DIRS: [
            "/etc/xdg/xdg-pantheon",
            "/etc/xdg"
        ],
        
        CACHE_HOME: "/home/user/.cache",
        
        CURRENT_DESKTOP: [
            "Pantheon" // Could by GNOME, KDE, Unity, etc. and more than one name
        ],
        
        USER_DIRS: { // dirs defined in $CONFIG_HOME/user-dirs.dirs
            DOWNLOAD: "/home/user/Descargas",
            TEMPLATES: "/home/user/Plantillas",
            PUBLICSHARE: "/home/user/Público",
            DOCUMENTS: "/home/user/Documentos",
            MUSIC: "/home/user/Música",
            PICTURES: "/home/user/Imágenes",
            VIDEOS: "/home/user/Vídeos",
            DESKTOP: "/home/user/Escritorio"
        }
    }

    Install

    npm i xdg-env

    DownloadsWeekly Downloads

    1

    Version

    0.0.3

    License

    none

    Last publish

    Collaborators

    • rawiroaisen