0.3.4 • Published 6 years ago

logpath v0.3.4

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

logpath

NPM version NPM downloads Dependencies MIT License

A simple module to get a custom node.js app log dir path across platforms

Install

$ npm install --save logpath

Use

const logpath = require('logpath');

const logDirPath = logpath.createAndGetLogDirPath();

logpath creates directory if not found and tries to return log directory paths in the following order:

On Linux

  1. /var/log/${APP_NAME}
  2. ${XDG_CONFIG_HOME}/${APP_NAME}
  3. ${HOME}/.config/${APP_NAME}
  4. ${XDG_DATA_HOME}/${APP_NAME}
  5. ${HOME}/.local/share/${APP_NAME}

On MacOS

  1. ${HOME}/Library/Logs/${APP_NAME}
  2. ${HOME}/Library/Application Support/${APP_NAME}

On Windows

  1. ${APPDATA}/${APP_NAME}
  2. ${HOME}/AppData/Roaming/${APP_NAME}

Where ${APP_NAME} is the name of the application using logpath, retrieved from package.json

Default

On any other platform, or if the directory path could not be returned (e.g. due to lack of read/write privileges), logpath will try and create a logs dir under the application's root folder.

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago