{"id":21667252,"url":"https://github.com/luftywiranda13/g-status","last_synced_at":"2025-04-12T01:32:25.456Z","repository":{"id":57140941,"uuid":"118339264","full_name":"luftywiranda13/g-status","owner":"luftywiranda13","description":"Get the change between index (or staging-area) and working tree of a `git` repository","archived":false,"fork":false,"pushed_at":"2020-06-03T09:19:48.000Z","size":157,"stargazers_count":2,"open_issues_count":9,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T21:12:26.978Z","etag":null,"topics":["git","parse","staged","staging","staging-area","status","working-directory","working-tree"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luftywiranda13.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-21T13:54:20.000Z","updated_at":"2018-05-01T05:14:14.000Z","dependencies_parsed_at":"2022-09-01T22:50:09.393Z","dependency_job_id":null,"html_url":"https://github.com/luftywiranda13/g-status","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fg-status","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fg-status/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fg-status/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fg-status/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luftywiranda13","download_url":"https://codeload.github.com/luftywiranda13/g-status/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248395629,"owners_count":21096801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","parse","staged","staging","staging-area","status","working-directory","working-tree"],"created_at":"2024-11-25T11:35:33.205Z","updated_at":"2025-04-12T01:32:25.429Z","avatar_url":"https://github.com/luftywiranda13.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# g-status\n\n\u003e Get the change between index (or staging-area) and working directory of a `git` repository\n\n[![Package Version](https://img.shields.io/npm/v/g-status.svg?style=flat-square)](https://www.npmjs.com/package/g-status)\n[![Downloads Status](https://img.shields.io/npm/dm/g-status.svg?style=flat-square)](https://npm-stat.com/charts.html?package=g-status\u0026from=2016-04-01)\n[![Build Status: Linux](https://img.shields.io/travis/luftywiranda13/g-status/master.svg?style=flat-square)](https://travis-ci.org/luftywiranda13/g-status)\n[![Coverage Status](https://img.shields.io/codecov/c/github/luftywiranda13/g-status/master.svg?style=flat-square)](https://codecov.io/gh/luftywiranda13/g-status)\n\nThink of `git status` or `git status --porcelain`, but returns a _ready-to-consume_ result.\n\n## Why\n\n* Maintained\n* Accepts simple [wildcard matching](https://github.com/sindresorhus/matcher) patterns\n* Promise API\n* Ability to get specific results based on status codes\n* Knows which files are partially/fully-staged\n\n## Installation\n\n```sh\nnpm install g-status\n```\n\n## Usage\n\n```sh\n$ git status --porcelain\n\nA  .travis.yml  # fully-staged\nMM index.js     # partially-staged\n M readme.md    # unstaged\n```\n\n```js\nconst gStatus = require('g-status');\n\ngStatus().then(res =\u003e {\n  console.log(res);\n  /*\n    [\n      { path: '.travis.yml', index: 'A', workingTree: ' ' },\n      { path: 'index.js', index: 'M', workingTree: 'M' },\n      { path: 'readme.md', index: ' ', workingTree: 'M' }\n    ]\n  */\n});\n\ngStatus({ path: ['!*.js', '!*.md'] }).then(res =\u003e {\n  console.log(res);\n  //=\u003e [{ path: '.travis.yml', index: 'A', workingTree: ' ' }]\n});\n\n// Files marked as `Modified` or `Added` in the staging area,\ngStatus({ index: 'MA' }).then(res =\u003e {\n  console.log(res);\n  /*\n    [\n      { path: '.travis.yml', index: 'A', workingTree: ' ' },\n      { path: 'index.js', index: 'M', workingTree: 'M' },\n    ]\n  */\n});\n\n// Files that arenʼt changed in the working tree\ngStatus({ workingTree: ' ' }).then(res =\u003e {\n  console.log(res);\n  //=\u003e [{ path: '.travis.yml', index: 'A', workingTree: ' ' }]\n});\n\n// Files that are marked as `Modified` both in staging area and working tree\ngStatus({ index: 'M', workingTree: 'M' }).then(res =\u003e {\n  console.log(res);\n  //=\u003e [{ path: 'index.js', index: 'M', workingTree: 'M' }]\n});\n```\n\nSee the [tests](https://github.com/luftywiranda13/g-status/blob/master/test.js) for more usage examples and expected matches.\n\n## API\n\n### gStatus([options])\n\nReturns `Promise\u003c{ path: string, index: string, workingTree: string }[]\u003e`.\n\n#### options\n\nType: `Object`\n\n##### cwd\n\nType: `string`\u003cbr /\u003e\nDefault: `process.cwd()`\n\nCurrent working directory.\n\n##### path\n\nType: `string` | `string[]`\u003cbr /\u003e\nDefault: `*`\n\nUse `*` to match zero or more characters. A pattern starting with `!` will be negated.\n\n##### index\n\nType: `string`\u003cbr /\u003e\nDefault: `*`\n\nString of `git` status codes of the index/staging-area, See [Short Format](https://git-scm.com/docs/git-status#_short_format).\u003cbr /\u003e\nOne difference is that `*` will match all value here.\n\n##### workingTree\n\nType: `string`\u003cbr /\u003e\nDefault: `*`\n\nString of `git` status codes of the working tree, See [Short Format](https://git-scm.com/docs/git-status#_short_format).\u003cbr /\u003e\nOne difference is that `*` will match all value here.\n\n## Related\n\n* [simple-git](https://github.com/steveukx/git-js) – Simple git interface for Node.js\n* [staged-git-files](https://github.com/mcwhittemore/staged-git-files) – Abandoned, the latest commit was 3 years ago\n\n## License\n\nMIT \u0026copy; [Lufty Wiranda](https://www.luftywiranda.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluftywiranda13%2Fg-status","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluftywiranda13%2Fg-status","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluftywiranda13%2Fg-status/lists"}