Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Node bindings to the libgit2 project.
Linux & macOS | Windows | Coverage | Dependencies |
---|---|---|---|
Stable (libgit2@v0.27.3): 0.27.3
Visit slack.libgit2.org to sign up, then join us in #nodegit.
Tim Branyen @tbranyen, John Haley @johnhaley81, and Max Korp @maxkorp with help from tons of awesome contributors!
Steve Smith @orderedlist, Michael Robinson @codeofinterest, and Nick Kallen @nk
NodeGit will work on most systems out-of-the-box without any native dependencies.
npm install nodegit
If you receive errors about libstdc++, which are commonly experienced when building on Travis-CI, you can fix this by upgrading to the latest libstdc++-4.9.
In Ubuntu:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install libstdc++-4.9-dev
In Travis:
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libstdc++-4.9-dev
In CircleCI:
dependencies:
pre:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get install -y libstdc++-4.9-dev
If you receive errors about lifecycleScripts preinstall/install you probably miss libssl-dev In Ubuntu:
sudo apt-get install libssl-dev
Additionally, you need curl-config
on your system. You need one of these packages:
If you are still encountering problems while installing, you should try the Building from source instructions.
var Git = require("nodegit");
// Clone a given repository into the `./tmp` folder.
Git.Clone("https://github.com/nodegit/nodegit", "./tmp")
// Look up this known commit.
.then(function(repo) {
// Use a known commit sha from this repository.
return repo.getCommit("59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5");
})
// Look up a specific file within that commit.
.then(function(commit) {
return commit.getEntry("README.md");
})
// Get the blob contents from the file.
.then(function(entry) {
// Patch the blob to contain a reference to the entry.
return entry.getBlob().then(function(blob) {
blob.entry = entry;
return blob;
});
})
// Display information about the blob.
.then(function(blob) {
// Show the path, sha, and filesize in bytes.
console.log(blob.entry.path() + blob.entry.sha() + blob.rawsize() + "b");
// Show a spacer.
console.log(Array(72).join("=") + "\n\n");
// Show the entire file.
console.log(String(blob));
})
.catch(function(err) { console.log(err); });
var Git = require("nodegit");
// Open the repository directory.
Git.Repository.open("tmp")
// Open the master branch.
.then(function(repo) {
return repo.getMasterCommit();
})
// Display information about commits on master.
.then(function(firstCommitOnMaster) {
// Create a new history event emitter.
var history = firstCommitOnMaster.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();
});
For more examples, check the examples/
folder.
You will need to build locally before running the tests. See above.
npm test
<a name="v0-25-0-alpha-12" href="#v0-25-0-alpha-12">v0.25.0-alpha.12</a> (2019-06-03)
FAQs
Node.js libgit2 asynchronous native bindings
The npm package nodegit receives a total of 36,749 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.