{"name":"staged-git-files","version":"1.2.0","devDependencies":{"should":"~2.0.1","mocha":"^2.0.1"},"description":"get a list of staged git files and their status","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"bin":{"sgf":"bin/cli.js"},"repository":{"type":"git","url":"git://github.com/mcwhittemore/staged-git-files.git"},"keywords":["git","pre-commit","post-commit","hooks"],"author":{"name":"Matthew Chase Whittemore","email":"mcwhittemore@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/mcwhittemore/staged-git-files/issues"},"gitHead":"402f43d72662cde245fdef4d736d9e259e05c28d","homepage":"https://github.com/mcwhittemore/staged-git-files#readme","_id":"staged-git-files@1.2.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"},"dist":{"integrity":"sha512-MYK3aDsO8XAXkv2ASsrznObxVDlocYm7gc/cMk/hB4vbJZeEqOO7H1mZR7EY2C5q3YgKOBo3Tmu0D30h7RjdWg==","shasum":"05b43f4fcec6d4799ac41c826ecd17c0bd53ce82","tarball":"http://registry-npm.ywwl.com/staged-git-files/download/staged-git-files-1.2.0.tgz","fileCount":10,"unpackedSize":25402,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc0aMNCRA9TVsSAnZWagAA8z4P/2HZRStOAqlED/wX+TyA\nfG/fo/ovTlOHUPh42ogXaLp8lkOB+o88IxBorW9QFXOZ4q9e1RQlfMsjzIw4\nkCPjhFzj/fCyCGN2OuMvSRrreU6Zeu/oYW7fQo5PLyBQibwiaFyfY5tlYLkv\naIm+ojhER1E1Kcj0dGXkURa2NTlgSU2kQp/Ioq2iv0DT5ItI6oRnQG9MR/nL\nB1zREVEX0JQ4sTfy1fTwtgfyJsIXiAChtC1xcj4XiG2MgMF9SLX6Z3KoFwyP\n3SylzzajTeZKvFTFPsNT3gqdYc9APABVqsnUCslqndynH9ZGuyoEHBpVe4Pg\nBtmimK7KdxWDKv5RKW+AKGK1Cn6uz5Vv76K2kHF2CC360rttVDMEEFBzSTdq\nPzs1KH35bRE6t0Ug7gu7iCGpBP/Hpxmr4VYPRr2nuenap6EmCI6fCE9O4Nyx\nMiYKRJSjJUiCHfPuKh7gOhM53YRK/Im8Oy9Wm0owV8dpucWcQChcZgxDm7ZT\nLxIFi5a8wG2Arv4PYBDfgXN2dvl23tcxeWbQ9BQ0RdCt6gckGTGMJpFwJOs6\nRvVokzQ+Z8aI67cqP4WwxM8cUqsT/elLyJS+4htcRueU1p/jyH08R4da6axT\nnr15ITrDo3yP/IlyksBtpxEvV1gEApt0vNdYJfw1UZDa1wnK8ilL6iADOEWo\nMbIy\r\n=8Mfp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHqHXd9FAFbHqPBXdx/jMlkofhNfePyRZjalZ6iqQS9QIhAMQaUoMGe1aGyTGBx8qnLyjs4U4cqP3RF0C54kfkR8k9"}],"size":6320,"noattachment":false,"key":"/staged-git-files/-/staged-git-files-1.2.0.tgz"},"maintainers":[{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/staged-git-files_1.2.0_1557242636482_0.9644752991638383"},"_hasShrinkwrap":false,"readme":"# Staged Git Files\n\nThis module returns an array of staged files and their status acording to git.\n\n[![Build Status](https://travis-ci.org/mcwhittemore/staged-git-files.svg?branch=master)](https://travis-ci.org/mcwhittemore/staged-git-files)\n\n## Usage\n\n`npm install staged-git-files`\n\n\n```js\nvar sgf = require(\"staged-git-files\");\nsgf(function(err, results){\n\t//WHAT EVER YOU SO PLEASE\n});\n```\n\n**Example Results**\n\n```json\n[\n\t{\n\t\t\"filename\": \"package.json\",\n\t\t\"status\": \"Added\"\n\t},\n\t{\n\t\t\"filename\": \"readme.md\",\n\t\t\"status\": \"Modified\"\n\t},\n\t{\n\t\t\"filename\": \"index.js\",\n\t\t\"status\": \"Renamed\"\n\t}\n]\n```\n\n## Usage as a cli\n\n```sh\n$ sgf\nAdded package.json\nModified readme.md\nRenamed index.js\n```\n\n## API\n\n### sgf(filter, callback)\n\nGet a list of staged git files\n\n* options:\n  * filter: string of git status codes. No spaces\n  * relative: boolean, tells [diff to run in relative mode](https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---relativeltpathgt)\n* callback:\n\t* err: the error\n\t* results: file object array.\n\nIf you omit a callback `sgf` will return a promise. How to use with `async`/`await`:\n\n```javascript\nasync function main () {\n\tconst stagedFiles = await sgf();\n}\n\nmain();\n```\n\n\n### sgf.getHead(callback)\n\nGet head that will be used in the diff to ID which files are waiting to be staged.\n\n* callback\n\t* err: the error\n\t* head: the git commit id which is aliased to head.\n\n### sgf.readFile(filename, [options], callback)\n\nThis is a proxy for [fs.readFile](http://nodejs.org/api/fs.html#fs_fs_readfile_filename_options_callback) with one change. The filename will be relative to the `sgf.cwd`\n\n### sgf.debug\n\nBoolean that flips logging on and off. By default this is false. If true, all git commands will be console logged.\n\n### sgf.includeContent\n\nIf true, include content will add a `content` or `err` param to the file object.\n\n* Default Value: false\n* Content Param: the content of the file staged\n* Err Param: the error message received while trying to read the file.\n\n### sgf.cwd\n\nThe current working directory. AKA: where the .git folder you care about is.\n\n# Default Value: is equal to process.cwd() of your app.g\n\n## Statuses\n\n**SGF-Status (git status code)**\n\n* Added (A)\n* Copied (C)\n* Deleted (D)\n* Modified (M)\n* Renamed (R)\n* Type-Change (T) [i.e. regular file, symlink, submodule, etc.]\n* Unmerged (U)\n* Unknown (X)\n","publish_time":1557242636585,"_cnpm_publish_time":1557242636585,"dist-tags":{"latest":"1.3.0"}}