
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
git-parseis a utility which generates an array of javascript objects representing the current branch of a local git repository's commit history.
npm install git-parse
const { gitToJs } = require('git-parse');
const commitsPromise = gitToJs('path/to/repo/');
commitsPromise.then(commits => console.log(JSON.stringify(commits, null, 2)));
[
{
"hash": "7cedc121ee163d859dfdb9911e627d4b5933cc6d",
"authorName": "mpackard@wayfair.com",
"authorEmail": "mpackard@wayfair.com",
"date": "Wed, 10 Jan 2018 16:44:52 -0500",
"message": "initial setup",
"filesAdded":[
{ "path": "packages/raspberry-popsicle/index.js" },
{ "path": "packages/raspberry-popsicle/package-lock.json" },
{ "path": "packages/raspberry-popsicle/package.json" }
],
"filesDeleted": [],
"filesModified": [],
"filesRenamed": []
},
{
"hash": "226f032eb87ac1eb18b7212eeaf1356980a9ae03",
"authorName": "mpackard@wayfair.com",
"authorEmail": "mpackard@wayfair.com",
"date": "Wed, 10 Jan 2018 15:25:16 -0500",
"message": "add README",
"filesAdded": [
{ "path": "README.md" }
],
"filesDeleted": [],
"filesModified": [],
"filesRenamed": []
}
]
Returns a promise which resolves with a list of objects describing git commits on the current branch. pathToRepo is a string. options is an optional object with one property, sinceCommit, which is a commit hash. If sinceCommit is present, gitToJs will return logs for commits after the commit specified.
const { gitToJs } = require('git-parse');
const commitsPromise = gitToJs('path/to/repo/');
commitsPromise.then(commits => console.log(JSON.stringify(commits, null, 2)));
Checks a repository out to a given commit. hash is the commit hash. Options is an optional object with one property, force. force adds --force to the underlying git checkout. Returns a promise.
Runs 'git pull' on the repository at the given path. Returns a promise.
Returns a git diff given a path to the repo, a commit, an optional second commit, and an optional file path.
Returns a promise resolving with the diff as a string.
To generate a local distribution for the git-parse library run the following command:
yarn build
To build the library in the background on file changes, use:
yarn build:watch
To automatically format the code using Prettier run:
yarn format
or
yarn format:check
To lint the project using ESLint run:
yarn lint
To run the project tests using the Jest framework run:
yarn test
To check the project for type errors using Typescript run:
yarn tsc
Use --watch to run the type checker in the background:
yarn tsc --watch
This project is licensed under the BSD-2-Clause license.
FAQs
Turn a git repository into a javascript object.
The npm package git-parse receives a total of 156,455 weekly downloads. As such, git-parse popularity was classified as popular.
We found that git-parse demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.