
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Get parsed git log data easily for analysis
glg
needs node >= 6.x.x
$ yarn add glg
# or npm install glg --save
This example uses async/await
, but you can simply use Promise
.
const glg = require('glg');
(async () => {
const results: Array<Commit> = await glg(process.cwd());
// do something
})();
By default glg
will use #~#^#
as commit separator and ^^^
as commit info separator. If for some reason your commits contain those characters, it will mess up the parsing. You can change it through 2nd arguments
const options = {
// separator between commits
separator: 'xxxx',
// separator between commit information in single commit
infoSeparator: 'yyyy',
};
const results = await glg(process.cwd(), options)
By default glg
will only provides a few info inside a single commit. You can also provides custom commit data map if you want more information on your git log by using commitDataMap
option
// These are default commit data map
// It maps object property that will be returned in array of result
// and uses its value to generate data, for example '%h' is used to retrieve
// commit hash. More information can be found in `git log --format`
const commitDataMap = {
commitHash: "%h",
authorEmail: "%ae",
authorName: "%an",
subject: "%s",
createdDate: "%ad",
publishedDate: "%cd"
};
const results = glg(process.cwd(), { commitDataMap });
type Commit = CommitDataMap & {
changes: Array<Change>,
};
type Change = BasicChange | RenameChange;
type BasicChange = {
type: string,
path: string,
};
type RenameChange = {
type: string,
path: string,
from: string,
};
$ yarn global add glg
# or npm install -g glg
$ glg ~/git/directory
# or npx glg ~/git/directory
MIT
FAQs
Git log parser
The npm package glg receives a total of 3 weekly downloads. As such, glg popularity was classified as not popular.
We found that glg 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.