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

tiny-commit-walker

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-commit-walker

tiny commit walker

  • 0.1.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
53K
increased by9.86%
Maintainers
1
Weekly downloads
 
Created
Source

Tiny commit walker

Tiny git commit walker has no native modules.

Build Status npm version

Install

$ npm install --save tiny-commit-walker

Usage

import { Repository } from 'tiny-commit-walker';

(async () => {
  const repo = new Repository('path/to/repo/.git');
  // const repo = new Repository(await Repository.findGitDir('path/to/repo'));
  const branches = await repo.readBranches();
  const tags = await repo.readTags();
  const branch = await repo.readCommitByBranch('master');
  console.log(branch.name); // master
  let commit = branch.commit;
  while (commit.hasParents) {
    console.log(commit.hash);
    commit = await commit.walk(); // default parameter of commit.walk is base parent hash.
  }
})();

// or

const repo = new Repository('path/to/repo/.git');
const branches = repo.readBranchesSync();
const tags = repo.readTagsSync();
const branch = repo.readCommitByBranchSync('master');
console.log(branch.name); // master
let commit = branch.commit;
while (commit.hasParents) {
  console.log(commit.hash);
  commit = commit.walkSync();
}

Documentation

https://ukyo.github.io/tiny-commit-walker

FAQs

Package last updated on 25 Jul 2017

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