{"id":24923035,"url":"https://github.com/nativecode-dev/common-locations","last_synced_at":"2026-04-12T00:44:11.702Z","repository":{"id":57204308,"uuid":"81452190","full_name":"nativecode-dev/common-locations","owner":"nativecode-dev","description":"Node module that provides access to common locations across platforms.","archived":false,"fork":false,"pushed_at":"2017-10-30T22:35:45.000Z","size":80,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-01T13:20:22.005Z","etag":null,"topics":["common-locations","config","configuration","darwin","etc","linux","locations","node","windows"],"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/nativecode-dev.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}},"created_at":"2017-02-09T13:19:51.000Z","updated_at":"2017-02-25T04:17:28.000Z","dependencies_parsed_at":"2022-09-18T01:00:49.081Z","dependency_job_id":null,"html_url":"https://github.com/nativecode-dev/common-locations","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativecode-dev%2Fcommon-locations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativecode-dev%2Fcommon-locations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativecode-dev%2Fcommon-locations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativecode-dev%2Fcommon-locations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nativecode-dev","download_url":"https://codeload.github.com/nativecode-dev/common-locations/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativecode-dev%2Fcommon-locations/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":257591552,"owners_count":22569738,"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":["common-locations","config","configuration","darwin","etc","linux","locations","node","windows"],"created_at":"2025-02-02T11:34:26.922Z","updated_at":"2025-10-29T03:33:18.089Z","avatar_url":"https://github.com/nativecode-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# common-locations\n\n[![npm](https://img.shields.io/npm/v/common-locations.svg?style=flat-square)](https://www.npmjs.com/package/common-locations)\n[![Travis](https://img.shields.io/travis/nativecode-dev/common-locations.svg?style=flat-square\u0026label=travis)](https://travis-ci.org/nativecode-dev/common-locations)\n[![TeamCity](https://img.shields.io/teamcity/https/build.nativecode.com/s/commonlocations_continuous.svg?style=flat-square\u0026lbabel=teamcity)](https://build.nativecode.com/viewType.html?buildTypeId=commonlocations_continuous\u0026guest=1)\n[![David](https://img.shields.io/david/nativecode-dev/common-locations.svg?style=flat-square\u0026label=deps)](https://www.npmjs.com/package/common-locations)\n[![David](https://img.shields.io/david/dev/nativecode-dev/common-locations.svg?style=flat-square\u0026label=devdeps)](https://www.npmjs.com/package/common-locations)\n\nNode module that provides access to common locations across platforms.\n\n# Installation\n```\nnpm install --save common-locations\n```\n\n# Usage\n\nThe default usage of the library can be invoked by just requiring the package\nand passing the name of your application.\n```javascript\nconst cl = require('common-locations')\nconst locations = cl('myapp')\n```\n\nIf you wish to use with [memfs](https://www.npmjs.com/package/memfs) or\n[unionfs](https://www.npmjs.com/package/unionfs), you can optionally pass in an\n`fs` object.\n```javascript\nconst fs = require('fs')\nconst cl = require('common-locations')\nconst locations = cl.use('myapp', fs)\n```\n\nYou can also pass in an `env` object as well, that is merged with the `process.env`\nvariables.\n```javascript\nconst locations = cl.use('myapp', fs, {\n  NODE_ENV: 'debug'\n})\n```\n\nNOTE: It will mainly affect Windows as most of the directory locations are pulled\nfrom environment variables.\n\nOnce you've required the module, you can access the various methods in the namespace.\n```javascript\nconst home = locations.home()\n```\n\nThe above will return `/home/\u003cusername\u003e` on POSIX systems or `C:\\Users\\\u003cusername\u003e` on\nWindows machines. You can optionally pass additional directory parts as well.\n```javascript\nconst home = locations.home('etc', 'myapp')\n```\n\nThe above will return `/home/\u003cusername\u003e/etc/myapp`.\n\nNOTE: You will have to view the source to see the other options until the API is finalized\nand documentation is produced.\n\n- app\n    - local()\n    - system()\n    - user()\n- binaries\n    - local()\n    - system()\n    - user()\n- config\n    - local()\n    - system()\n    - user()\n- home()\n- log\n    - local()\n    - system()\n    - user()\n- temp()\n\n## TODO\n- ~~Implement polyfill for `os.userInfo`.~~ [common-userinfo](https://www.npmjs.com/package/common-userinfo)\n- Implement some sort of `mkdir` when grabbing paths.\n- Implement Mac OSX paths, which currently uses the same as POSIX paths.\n\n# Development Setup\n```\nnpm install\n```\n\nNOTE: If you are using an editor and would like to run `gulp` commands in your IDE,\nyou'll need to also install `gulp-cli` globally.\n```\nnpm install -g gulp-cli\n```\n\n# License\nCopyright 2017 NativeCode Development \u003csupport@nativecode.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the Software without restriction, including without\nlimitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\nSoftware, and to permit persons to whom the Software is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\nTHE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\nCONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativecode-dev%2Fcommon-locations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnativecode-dev%2Fcommon-locations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativecode-dev%2Fcommon-locations/lists"}