{"id":15620658,"url":"https://github.com/akb89/logpath","last_synced_at":"2025-03-29T15:43:57.149Z","repository":{"id":98209465,"uuid":"101154369","full_name":"akb89/logpath","owner":"akb89","description":"A simple module to get a custom node.js app log dir path across platforms","archived":false,"fork":false,"pushed_at":"2018-01-18T19:29:42.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T06:51:32.118Z","etag":null,"topics":["cross-platform","log","node-module","pathfinding"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akb89.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-08-23T08:01:21.000Z","updated_at":"2017-08-23T11:40:44.000Z","dependencies_parsed_at":"2023-05-18T15:37:49.348Z","dependency_job_id":null,"html_url":"https://github.com/akb89/logpath","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":"0.16666666666666663","last_synced_commit":"fc8fe020c1c25779b578843d9e65736aae758a41"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akb89%2Flogpath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akb89%2Flogpath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akb89%2Flogpath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akb89%2Flogpath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akb89","download_url":"https://codeload.github.com/akb89/logpath/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246207491,"owners_count":20740723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cross-platform","log","node-module","pathfinding"],"created_at":"2024-10-03T09:01:52.315Z","updated_at":"2025-03-29T15:43:57.119Z","avatar_url":"https://github.com/akb89.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# logpath\n[![NPM version][npm-version-image]][npm-url]\n[![NPM downloads][npm-downloads-image]][npm-url]\n[![Dependencies][david-dep-image]][david-url]\n[![MIT License][license-image]][license-url]\n\nA simple module to get a custom node.js app log dir path across platforms\n\n## Install\n```shell\n$ npm install --save logpath\n```\n\n## Use\n```\nconst logpath = require('logpath');\n\nconst logDirPath = logpath.createAndGetLogDirPath();\n```\n\nlogpath creates directory if not found and tries to return log directory paths in the following order:\n\n### On Linux\n1. `/var/log/${APP_NAME}`\n2. `${XDG_CONFIG_HOME}/${APP_NAME}`\n3. `${HOME}/.config/${APP_NAME}`\n4. `${XDG_DATA_HOME}/${APP_NAME}`\n5. `${HOME}/.local/share/${APP_NAME}`\n\n### On MacOS\n1. `${HOME}/Library/Logs/${APP_NAME}`\n2. `${HOME}/Library/Application Support/${APP_NAME}`\n\n### On Windows\n1. `${APPDATA}/${APP_NAME}`\n2. `${HOME}/AppData/Roaming/${APP_NAME}`\n\nWhere ${APP_NAME} is the name of the application using logpath, retrieved from `package.json`\n\n### Default\nOn 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\nunder the application's root folder.\n\n[npm-version-image]:https://img.shields.io/npm/v/logpath.svg?style=flat-square\n[npm-downloads-image]:https://img.shields.io/npm/dt/logpath.svg?style=flat-square\n[npm-url]:https://www.npmjs.com/package/logpath\n[license-image]:http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square\n[license-url]:LICENSE.txt\n[david-dep-image]: https://david-dm.org/akb89/logpath.svg?style=flat-square\n[david-url]: https://david-dm.org/akb89/logpath\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakb89%2Flogpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakb89%2Flogpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakb89%2Flogpath/lists"}