
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Get the change between index (or staging-area) and working directory of a `git` repository
Get the change between index (or staging-area) and working directory of a
git
repository
Think of git status
or git status --porcelain
, but returns a ready-to-consume result.
npm install g-status
$ git status --porcelain
A .travis.yml # fully-staged
MM index.js # partially-staged
M readme.md # unstaged
const gStatus = require('g-status');
gStatus().then(res => {
console.log(res);
/*
[
{ path: '.travis.yml', index: 'A', workingTree: ' ' },
{ path: 'index.js', index: 'M', workingTree: 'M' },
{ path: 'readme.md', index: ' ', workingTree: 'M' }
]
*/
});
gStatus({ path: ['!*.js', '!*.md'] }).then(res => {
console.log(res);
//=> [{ path: '.travis.yml', index: 'A', workingTree: ' ' }]
});
// Files marked as `Modified` or `Added` in the staging area,
gStatus({ index: 'MA' }).then(res => {
console.log(res);
/*
[
{ path: '.travis.yml', index: 'A', workingTree: ' ' },
{ path: 'index.js', index: 'M', workingTree: 'M' },
]
*/
});
// Files that arenʼt changed in the working tree
gStatus({ workingTree: ' ' }).then(res => {
console.log(res);
//=> [{ path: '.travis.yml', index: 'A', workingTree: ' ' }]
});
// Files that are marked as `Modified` both in staging area and working tree
gStatus({ index: 'M', workingTree: 'M' }).then(res => {
console.log(res);
//=> [{ path: 'index.js', index: 'M', workingTree: 'M' }]
});
See the tests for more usage examples and expected matches.
Returns Promise<{ path: string, index: string, workingTree: string }[]>
.
Type: Object
Type: string
Default: process.cwd()
Current working directory.
Type: string
| string[]
Default: *
Use *
to match zero or more characters. A pattern starting with !
will be negated.
Type: string
Default: *
String of git
status codes of the index/staging-area, See Short Format.
One difference is that *
will match all value here.
Type: string
Default: *
String of git
status codes of the working tree, See Short Format.
One difference is that *
will match all value here.
MIT © Lufty Wiranda
FAQs
Get the change between index (or staging-area) and working directory of a `git` repository
The npm package g-status receives a total of 105,453 weekly downloads. As such, g-status popularity was classified as popular.
We found that g-status 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
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.