{"name":"staged-git-files","version":"0.0.3","devDependencies":{"node-hooks":"0.0.15","beautify.hks":"0.0.1","esprima.hks":"0.0.0","should":"~2.0.1"},"description":"get a list of staged git files and their status","main":"index.js","directories":{"test":"test"},"dependencies":{"esprima.hks":"~0.0.0","beautify.hks":"~0.0.1","node-hooks":"~0.0.15"},"scripts":{"test":"mocha"},"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"},"homepage":"https://github.com/mcwhittemore/staged-git-files","_id":"staged-git-files@0.0.3","_shasum":"503c63dbfbb64fe8a37e676f987f90cc1bfeb46f","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"},"maintainers":[{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"}],"dist":{"shasum":"503c63dbfbb64fe8a37e676f987f90cc1bfeb46f","tarball":"http://registry-npm.ywwl.com/staged-git-files/download/staged-git-files-0.0.3.tgz","integrity":"sha512-LlZgtaEv4GhGUruPliLFDJ4Od/w9f6hdKNgSCDhME9luLlAOSPTG1T+JkPlyPow42OGnKxemfQUwEjuD9xBjbw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnPB31q5S8inPOCjviWriim3Tgv1ledGjQ+Uf44vlyYQIgSTS/wk87ct/Y39y4eTZmN7kf2nnxw59mrry4UbinkoA="}],"size":3996,"noattachment":false,"key":"/staged-git-files/-/staged-git-files-0.0.3.tgz"},"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":1416162052909,"_cnpm_publish_time":1416162052909,"dist-tags":{"latest":"1.3.0"}}