{"name":"g-status","version":"2.0.1","description":"Get the change between index (or staging-area) and working directory of a `git` repository","license":"MIT","repository":{"type":"git","url":"git+https://github.com/luftywiranda13/g-status.git"},"author":{"name":"Lufty Wiranda","email":"lufty.wiranda@gmail.com","url":"https://www.luftywiranda.com"},"engines":{"node":">=6"},"scripts":{"precommit":"remove-lockfiles && xo --fix && lint-staged","test:watch":"jest --watch","test":"xo && jest --coverage"},"files":["index.js"],"dependencies":{"arrify":"^1.0.1","matcher":"^1.0.0","simple-git":"^1.85.0"},"devDependencies":{"async-to-gen":"^1.3.3","eslint-config-prettier":"^2.9.0","husky":"^0.14.3","jest":"^22.0.4","lint-staged":"^6.0.0","prettier":"^1.9.2","remove-lockfiles":"^2.0.4","xo":"^0.18.2"},"jest":{"testEnvironment":"node","transform":{"^.+\\.js$":"async-to-gen"}},"lint-staged":{"*.{js,json,md}":["prettier --write","git add"]},"prettier":{"singleQuote":true,"trailingComma":"es5"},"xo":{"extends":"prettier","envs":["jest"],"rules":{"camelcase":0}},"keywords":["git-status","git","index-area","staged","staging-area","staging","status","work-tree","working-directory","worktree"],"gitHead":"c7c681224e0ed998be25d93176f0087484c52be0","bugs":{"url":"https://github.com/luftywiranda13/g-status/issues"},"homepage":"https://github.com/luftywiranda13/g-status#readme","_id":"g-status@2.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"luftywiranda13","email":"lufty.wiranda@gmail.com"},"dist":{"integrity":"sha512-uEkfz94C41adUoHcnUs7Gc0wpqHZ7I+zvxz2iamGejyRetkASfIYSHWkW13KObOGwE8oFYbdPPOG4HBNKf5IiQ==","shasum":"7663c146eae992986eb64c17bae432fec6b98b96","tarball":"http://registry-npm.ywwl.com/g-status/download/g-status-2.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD91tIEkdPlqkkb0sXjtd97oRwFhY34ZvByWdKAQtBMZQIhANedxe6BeDmhaM/WGQn5d5gZoWARvSj2SAMbvulzvcHO"}],"size":3039,"noattachment":false,"key":"/g-status/-/g-status-2.0.1.tgz"},"maintainers":[{"name":"luftywiranda13","email":"lufty.wiranda@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/g-status-2.0.1.tgz_1516955984522_0.580497930990532"},"directories":{},"readme":"# g-status\n\n> 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&from=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 => {\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 => {\n  console.log(res);\n  //=> [{ path: '.travis.yml', index: 'A', workingTree: ' ' }]\n});\n\n// Files marked as `Modified` or `Added` in the staging area,\ngStatus({ index: 'MA' }).then(res => {\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 => {\n  console.log(res);\n  //=> [{ 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 => {\n  console.log(res);\n  //=> [{ 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<{ path: string, index: string, workingTree: string }[]>`.\n\n#### options\n\nType: `Object`\n\n##### cwd\n\nType: `string`<br />\nDefault: `process.cwd()`\n\nCurrent working directory.\n\n##### path\n\nType: `string` | `string[]`<br />\nDefault: `*`\n\nUse `*` to match zero or more characters. A pattern starting with `!` will be negated.\n\n##### index\n\nType: `string`<br />\nDefault: `*`\n\nString of `git` status codes of the index/staging-area, See [Short Format](https://git-scm.com/docs/git-status#_short_format).<br />\nOne difference is that `*` will match all value here.\n\n##### workingTree\n\nType: `string`<br />\nDefault: `*`\n\nString of `git` status codes of the working tree, See [Short Format](https://git-scm.com/docs/git-status#_short_format).<br />\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 &copy; [Lufty Wiranda](https://www.luftywiranda.com)\n","publish_time":1516955984634,"_cnpm_publish_time":1516955984634,"dist-tags":{"latest":"2.0.2"}}