{"id":20296066,"url":"https://github.com/likerrr/gitfig","last_synced_at":"2026-05-12T09:33:18.628Z","repository":{"id":77830203,"uuid":"85320517","full_name":"likerRr/gitfig","owner":"likerRr","description":"Resolves git config","archived":false,"fork":false,"pushed_at":"2017-03-20T12:54:01.000Z","size":56,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T22:16:39.914Z","etag":null,"topics":["asynchronous","config","git","gitconfig","javascript","js","object","promise"],"latest_commit_sha":null,"homepage":null,"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/likerRr.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-17T14:27:57.000Z","updated_at":"2017-03-20T09:18:58.000Z","dependencies_parsed_at":"2023-03-06T13:00:33.620Z","dependency_job_id":null,"html_url":"https://github.com/likerRr/gitfig","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/likerRr%2Fgitfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likerRr%2Fgitfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likerRr%2Fgitfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likerRr%2Fgitfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/likerRr","download_url":"https://codeload.github.com/likerRr/gitfig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241794112,"owners_count":20021188,"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":["asynchronous","config","git","gitconfig","javascript","js","object","promise"],"created_at":"2024-11-14T15:37:04.519Z","updated_at":"2026-05-12T09:33:18.594Z","avatar_url":"https://github.com/likerRr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build Status](https://img.shields.io/travis/likerRr/gitfig/master.svg)\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n![Dependencies](https://img.shields.io/david/likerRr/gitfig.svg)\n\n# Git(con)fig\n\nResolves and returns git config as an object\n\n## Install\n\n```\n$ npm install --save gitfig\n```\n\n\n## Usage\n\n```js\nconst gitFig = require('gitfig');\n\ngitFig();\n//=\u003e {name: 'Alexey Lizurchik', email: 'al.lizurchik@gmail.com'}\n```\n\n\n## API\n\n### gitfig([@type|path])\n\n#### @type\n\nPossible values are 0 and 2. Can be accessed throw the constants in exported object: `LOCAL`, `HOME`.\n\nExample:\n \n```javascript\nconst gitFig = require('gitfig');\n\nconsole.log(gitFig.LOCAL);\nconsole.log(gitFig.HOME);\n````\n\n#### path\n\nType: string\n\nPath for looking git config for. Works for both git repos (you don't need to add `.git` in path) and (custom) home path.\n\n----\n\nAsynchronously looks up for git config by cascade:\n1. The local config is looked for\n2. The home config is looked for\n\nReturns promise which rejects if git config is not found.\n\nAlternatively you can specify concrete place of look up:\n```javascript\nconst gitFig = require('gitfig');\n\ngitFig(); // cascade\ngitFig(gitFig.LOCAL); // current working directory (from where script is called)\ngitFig(gitFig.HOME); // current user's home path\ngitFig('/var/www/mysite'); // looks for /var/www/mysite/.git/config or if failed - /var/www/mysite/.gitconfig\n````\n\n### gitfig.sync(@type)\n\nSynchronous version (with the same lookup behaviour) which returns value rather then promise. \nThrows an error if git config is not found.\n\n## License\n\nMIT © [Alexey Lizurchik](https://github.com/likerRr)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flikerrr%2Fgitfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flikerrr%2Fgitfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flikerrr%2Fgitfig/lists"}