
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Gitty is a Node.js module that acts as a wrapper for the Git CLI. It uses methods that resemble the Git command line syntax to asynchronously execute common commands, and return passes the output as standard JavaScript objects and arrays - depending on the call.
$ npm install gitty
var git = require('gitty');
// get commit log as an array of objects
// and log to the console
git.history('/path/to/repo', function(output) {
console.log(output);
});
Internally, Gitty uses a private method repository(path)
that checks if the given path is a valid Git repository. If the check passes, then a child process is spawned and the process moves into the given directory to perform the command. After the callback is fired for the given function, Gitty moves the process back to it's original directory.
To ensure the best performance you should always use absolute or server-relative paths. For example '/users/username/repositories/projectname'.
All path
arguments should follow this convention.
Callbacks for all methods are given a single object. Usually, this object contains a single property and value. Successful operations get a message
property containing either the stdout
from the command or a message confirming the operation was successfull.
Failed operations get an error
property, for which the value is either one of: an error from Node, stderr
from the operation, or a message alert the operation failed - whichever is relevant.
This is not the case for every method. Refer to the method list below for specifics.
Gives an array of objects containing commit
, author
, date
, and message
.
Creates a directory at the given path, create a README markdown file with the name and desciption, initializes a git repository, and stages an initial commit.
Uninitializes the repository at the given path. The deletefiles
argument is a boolean that determines whether of not to also delete the contents of the repository.
Gives an object with properties for staged
, not_staged
, and untracked
. Each property represents an array of objects - each containing a file
and status
.
Adds an array of files for commit, and gives back and object of errors
(array) and added
(array).
Removes array of files for commit, and gives back and object of errors
(array) and added
(array).
Unstages array of files for commit, and gives back and object of errors
(array) and added
(array).
Stages a commit with message based on the current staged files.
Gives back an object representing the current
branch and an array of others
.
Creates a branch using the branchname
for the repository at the given path
Does a checkout on the given branchname
.
Adds a remote to the given repository.
Updates an existing remote's url.
Removes the given remote from the repository.
Returns an object where each key
is the remote name and val
is the remote url.
Pushes the passed branch
to the passed remote
.
Pulls the passed branch
from the passed remote
.
Resets the HEAD back to the status of the passed commit hash.
Merges the given branch
with the current branch.
Clones a remote repository into the specified path.
Gitty was written by Gordon Hall (gordon@gordonwritescode.com)
Licensed under MIT license
FAQs
A Node.js wrapper for the Git CLI
We found that gitty demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.