
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Node bindings to the libgit2 project.
Stable: 0.1.2
Maintained by Tim Branyen @tbranyen, Michael Robinson @codeofinterest, and Nick Kallen @nk, with help from awesome contributors!
http://www.nodegit.org/nodegit/
Minimum dependencies:
npm install nodegit
If you wish to help contribute to nodegit it is useful to build locally.
# Fetch this project.
git clone git://github.com/tbranyen/nodegit.git
# Enter the repository.
cd nodegit
# Install the template engine, run the code generation script, and install.
npm install ejs && npm run codegen && npm install
If you encounter errors, you most likely have not configured the dependencies correctly.
Using Brew:
brew install cmake libzip
Using APT in Ubuntu:
sudo apt-get install cmake libzip-dev build-essential
Using Pacman in Arch Linux:
sudo pacman -S cmake libzip base-devel
For Windows users, you will have to install Visual Studio Express. You may have to add a build flag to the installation process to successfully install. Try first without, if the build fails, try again with the flag.
Allegedly the order in which you install Visual Studio could trigger this error.
npm install nodegit --msvs_version=2013
# Or whatever version you've installed.
var clone = require("nodegit").Repo.clone;
// Clone a given repository into a specific folder.
clone("https://github.com/nodegit/nodegit", "tmp", null, function(err, repo) {
if (err) {
throw err;
}
// Use a known commit sha from this repository.
var sha = "59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5";
// Look up this known commit.
repo.getCommit(sha, function(err, commit) {
if (err) {
throw error;
}
// Look up a specific file within that commit.
commit.getEntry("README.md", function(err, entry) {
if (err) {
throw error;
}
// Get the blob contents from the file.
entry.getBlob(function(err, blob) {
if (err) {
throw err;
}
// Show the name, sha, and filesize in byes.
console.log(entry.name() + entry.sha() + blob.size() + "b");
// Show a spacer.
console.log(Array(72).join("=") + "\n\n");
// Show the entire file.
console.log(String(blob));
});
});
});
});
var open = require("nodegit").Repo.open;
// Open the repository directory.
open("tmp", function(err, repo) {
if (err) {
throw err;
}
// Open the master branch.
repo.getMaster(function(err, branch) {
if (err) {
throw err;
}
// Create a new history event emitter.
var history = branch.history();
// Create a counter to only show up to 9 entries.
var count = 0;
// Listen for commit events from the history.
history.on("commit", function(commit) {
// Disregard commits past 9.
if (++count >= 9) {
return;
}
// Show the commit sha.
console.log("commit " + commit.sha());
// Store the author object.
var author = commit.author();
// Display author information.
console.log("Author:\t" + author.name() + " <", author.email() + ">");
// Show the commit date.
console.log("Date:\t" + commit.date());
// Give some space and show the message.
console.log("\n " + commit.message());
});
// Start emitting events.
history.start();
});
});
You will need to build locally before running the tests. See above.
npm test
<a name="v0-1-2" href="#v0-1-2">v0.1.2</a> (2014-05-02)
Closed issues:
gyp ERR cannot find -lgit2 #150
Read file from git server #145
"emulate git log" example error #144
repo.workdir() crashes (SIGSEGV) on a bare repo #128
How to create Branch using the API? #124
'npm run-script gen && npm install' on Ubuntu 13.04 #122
Error while installing Nodegit 0.1.0 #120
Question: How would I implement the equivalent of git status
? #117
Sync versions of all the methods #115
Tick version # #107
Windows support #71
Create test for history with merge commits #64
Merged pull requests:
FAQs
Node.js libgit2 asynchronous native bindings
The npm package nodegit receives a total of 27,375 weekly downloads. As such, nodegit popularity was classified as popular.
We found that nodegit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.