Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
last-commit-log
Advanced tools
Node.js module to get the last git commit information - mostly to be used by CI/CD and building phase
Node.js module to get the last git commit information - mostly to be used by CI/CD and building phase.
const LCL = require('last-commit-log');
const lcl = new LCL(); // or `new LCL(dir)` dir is process.cwd() by default
Asychronous use, using a Promise:
lcl
.getLastCommit()
.then(commit => console.log(commit));
Synchronous use:
const commit = lcl.getLastCommitSync();
commit information is an object like this:
{
"gitTag": "2.0.0",
"gitBranch": "master",
"gitRemote": "git@github.com:group/repo.git", // .git http or ssh
"gitUrl": "http://github.com/group/repo", // url only
"shortHash": "42dc921",
"hash": "42dc921d25a3e7e1607302d2acfdc3fd991c0c01",
"subject": "chore: add lock",
"sanitizedSubject": "chore-add-lock",
"body": "",
"committer": {
"date": "1515240839",
"relativeDate": "2 hours ago",
"name": "Committer Fred",
"email": "fred@fred.com"
},
"author": {
"date": "1515240839",
"relativeDate": "2 hours ago",
"name": "Author Baz",
"email": "baz@baz.com"
}
}
Get map of line changed or added from git diff
:
const data = lcl.diff({
currentBranch: 'gh-pages',
});
/**
{
'/diff.js': [
[
1,
46
]
],
'/index.js': [
[
124,
125
]
],
'/package.json': [],
'/test/diff.test.js': [
[
1,
14
]
]
}
*/
console.log(data);
zhangyuheng | xudafeng | titanism | atidyshirt | stared | yihuineng |
---|---|---|---|---|---|
antife-yinyue |
This project follows the git-contributor spec, auto updated at Sun May 21 2023 11:57:56 GMT+0800
.
The MIT License (MIT)
FAQs
Node.js module to get the last git commit information - mostly to be used by CI/CD and building phase
We found that last-commit-log demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.