Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse-git-config

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-git-config

Parse `.git/config` into a JavaScript object. sync or async.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is parse-git-config?

The parse-git-config npm package is a utility for parsing git configuration files. It allows developers to read and interpret the configuration settings of git repositories programmatically. This can be useful for automating tasks, creating development tools, or integrating with other software that needs to understand git configurations.

What are parse-git-config's main functionalities?

Parse local git configuration

This feature allows you to parse the git configuration file of a local repository. The function takes options specifying the working directory and the path to the git config file, then returns the configuration as an object.

const parseGitConfig = require('parse-git-config');
parseGitConfig({ cwd: '/path/to/repo', path: '.git/config' }, (err, config) => {
  if (err) throw err;
  console.log(config);
});

Synchronously parse git config

This feature provides a synchronous method to parse the git config file. It is useful when you need to get the configuration data immediately without dealing with asynchronous callbacks.

const parseGitConfig = require('parse-git-config');
const config = parseGitConfig.sync({ cwd: '/path/to/repo', path: '.git/config' });
console.log(config);

Expand include paths

This feature supports expanding include directives in git config files, allowing you to see the full configuration with included paths resolved. This is particularly useful for complex configurations that use multiple included files.

const parseGitConfig = require('parse-git-config');
parseGitConfig.expandKeys({ include: true }).then(config => {
  console.log(config);
});

Other packages similar to parse-git-config

Keywords

FAQs

Package last updated on 25 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc