{"name":"staged-git-files","version":"1.1.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":"f3a351e433765f85ec67391f200f3776e98fcdf2","homepage":"https://github.com/mcwhittemore/staged-git-files#readme","_id":"staged-git-files@1.1.0","_shasum":"1a9bb131c1885601023c7aaddd3d54c22142c526","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.4","_npmUser":{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"},"dist":{"shasum":"1a9bb131c1885601023c7aaddd3d54c22142c526","tarball":"http://registry-npm.ywwl.com/staged-git-files/download/staged-git-files-1.1.0.tgz","fileCount":9,"unpackedSize":21045,"integrity":"sha512-X3WRk/D+jHicKRFGFZ9aHJLvDwvH/fcAi88EWWZ7yZKQXy/zr7m5RwelEPK78kT3pa0F5kUDu5Xeu+XEng7qcA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgBkURvgcNvRvriRhCXKc04bGkYLSoIlrpx2kkSRWnpAIhAOr/BblDKIZx/59lAiw9tmXkGcNlt+Z5NeYQStjp1lQA"}],"size":5481,"noattachment":false,"key":"/staged-git-files/-/staged-git-files-1.1.0.tgz"},"maintainers":[{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/staged-git-files_1.1.0_1519139300304_0.06301830132003894"},"_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":1519139300359,"_cnpm_publish_time":1519139300359,"dist-tags":{"latest":"1.3.0"}}