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

@sinet/git-refs

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sinet/git-refs

Determine references of a git repository via JavaScript

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Git Refs

Build Status Dependency Status devDependency Status

JavaScript implementation to get the git commit hashes for different references.

  • current branch (current)
  • local branches (heads)
  • remote branches (remotes)
  • tags (tags)

Tags aren't currently implemented, because they require being able to read the tag commit object. The other references just require reading the file contents.

Usage

npm install @sinet/git-refs --save

Example

const gitRefs = require( '@sinet/git-refs' );

gitRefs( '/path/to/.git', function ( error, refs ) {
	if ( error ) {
		return console.log( error );
	}

	console.log( "refs.current.head:", refs.current.head );
	console.log( refs );
} );

Contributing

All pull requests must follow coding conventions and standards.

FAQs

Package last updated on 23 Apr 2016

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