{"_id":"staged-git-files","_rev":"2832911","name":"staged-git-files","description":"get a list of staged git files and their status","dist-tags":{"latest":"1.3.0"},"maintainers":[{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"}],"time":{"modified":"2022-09-06T15:20:26.000Z","created":"2013-10-17T04:23:17.523Z","1.3.0":"2022-02-03T03:47:46.052Z","1.2.0":"2019-05-07T15:23:56.585Z","1.1.2":"2018-10-29T17:44:01.675Z","1.1.1":"2018-03-30T19:43:41.401Z","1.1.0":"2018-02-20T15:08:20.359Z","1.0.0":"2018-02-15T17:37:46.210Z","0.0.4":"2015-01-18T17:47:59.630Z","0.0.3":"2014-11-16T18:20:52.909Z","0.0.2":"2013-10-18T04:48:25.040Z","0.0.1":"2013-10-17T04:23:17.523Z"},"users":{"stringparser":true,"zafar.saleem":true,"ivanmendoza":true},"author":{"name":"Matthew Chase Whittemore","email":"mcwhittemore@gmail.com"},"repository":{"type":"git","url":"git://github.com/mcwhittemore/staged-git-files.git"},"versions":{"1.3.0":{"name":"staged-git-files","version":"1.3.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":"7a10914cc99899ca8a5c5c4b490fdc8d87bb7218","homepage":"https://github.com/mcwhittemore/staged-git-files#readme","_id":"staged-git-files@1.3.0","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"a6e3e96d88c6573d982f59154dfe66488039ec14","size":6289,"noattachment":false,"key":"/staged-git-files/-/staged-git-files-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/staged-git-files/download/staged-git-files-1.3.0.tgz"},"_npmUser":{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"},"maintainers":[{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/staged-git-files_1.3.0_1643860065927_0.5846256551951936"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-02-03T03:47:51.485Z","publish_time":1643860066052,"_cnpm_publish_time":1643860066052},"1.2.0":{"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":{"shasum":"05b43f4fcec6d4799ac41c826ecd17c0bd53ce82","size":6320,"noattachment":false,"key":"/staged-git-files/-/staged-git-files-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/staged-git-files/download/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,"publish_time":1557242636585,"_cnpm_publish_time":1557242636585},"1.1.2":{"name":"staged-git-files","version":"1.1.2","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":"ff43da4222a93a5aaaf1b47b628b7f65569a69a8","homepage":"https://github.com/mcwhittemore/staged-git-files#readme","_id":"staged-git-files@1.1.2","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"},"dist":{"shasum":"4326d33886dc9ecfa29a6193bf511ba90a46454b","size":5906,"noattachment":false,"key":"/staged-git-files/-/staged-git-files-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/staged-git-files/download/staged-git-files-1.1.2.tgz"},"maintainers":[{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/staged-git-files_1.1.2_1540835040190_0.6249724067579332"},"_hasShrinkwrap":false,"publish_time":1540835041675,"_cnpm_publish_time":1540835041675},"1.1.1":{"name":"staged-git-files","version":"1.1.1","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":"113b5be7d6881e8f1f93beca6e1b4b88139423cd","homepage":"https://github.com/mcwhittemore/staged-git-files#readme","_id":"staged-git-files@1.1.1","_npmVersion":"5.3.0","_nodeVersion":"6.9.1","_npmUser":{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"},"dist":{"shasum":"37c2218ef0d6d26178b1310719309a16a59f8f7b","size":5922,"noattachment":false,"key":"/staged-git-files/-/staged-git-files-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/staged-git-files/download/staged-git-files-1.1.1.tgz"},"maintainers":[{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/staged-git-files_1.1.1_1522439021329_0.1868024352423907"},"_hasShrinkwrap":false,"publish_time":1522439021401,"_cnpm_publish_time":1522439021401},"1.1.0":{"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","size":5481,"noattachment":false,"key":"/staged-git-files/-/staged-git-files-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/staged-git-files/download/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,"publish_time":1519139300359,"_cnpm_publish_time":1519139300359},"1.0.0":{"name":"staged-git-files","version":"1.0.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"},"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":"b63bb5c09209392825e537f2bcfb52ff43d33cb4","homepage":"https://github.com/mcwhittemore/staged-git-files#readme","_id":"staged-git-files@1.0.0","_shasum":"cdb847837c1fcc52c08a872d4883cc0877668a80","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.4","_npmUser":{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"},"dist":{"shasum":"cdb847837c1fcc52c08a872d4883cc0877668a80","size":4572,"noattachment":false,"key":"/staged-git-files/-/staged-git-files-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/staged-git-files/download/staged-git-files-1.0.0.tgz"},"maintainers":[{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/staged-git-files_1.0.0_1518716265558_0.400583831579606"},"_hasShrinkwrap":false,"publish_time":1518716266210,"_cnpm_publish_time":1518716266210},"0.0.4":{"name":"staged-git-files","version":"0.0.4","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"},"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":"c7b50a54d6c854f2318b82085047eefa25e7feca","homepage":"https://github.com/mcwhittemore/staged-git-files","_id":"staged-git-files@0.0.4","_shasum":"d797e1b551ca7a639dec0237dc6eb4bb9be17d35","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"},"maintainers":[{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"}],"dist":{"shasum":"d797e1b551ca7a639dec0237dc6eb4bb9be17d35","size":4360,"noattachment":false,"key":"/staged-git-files/-/staged-git-files-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/staged-git-files/download/staged-git-files-0.0.4.tgz"},"publish_time":1421603279630,"_cnpm_publish_time":1421603279630,"_hasShrinkwrap":false},"0.0.3":{"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","size":3996,"noattachment":false,"key":"/staged-git-files/-/staged-git-files-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/staged-git-files/download/staged-git-files-0.0.3.tgz"},"publish_time":1416162052909,"_cnpm_publish_time":1416162052909,"_hasShrinkwrap":false},"0.0.2":{"name":"staged-git-files","version":"0.0.2","devDependencies":{"node-hooks":"0.0.15","beautify.hks":"0.0.1","esprima.hks":"0.0.0","should":"~2.0.1","mocha":"~1.13.0"},"description":"get a list of staged git files and their status","main":"index.js","directories":{"test":"test"},"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"},"readmeFilename":"readme.md","_id":"staged-git-files@0.0.2","dist":{"shasum":"93197f1562fe98f53b130419fa84cb668f4410c3","size":3869,"noattachment":false,"key":"/staged-git-files/-/staged-git-files-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/staged-git-files/download/staged-git-files-0.0.2.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"},"maintainers":[{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"}],"publish_time":1382071705040,"_cnpm_publish_time":1382071705040,"_hasShrinkwrap":false},"0.0.1":{"name":"staged-git-files","devDependencies":{"node-hooks":"0.0.15","beautify.hks":"0.0.1","esprima.hks":"0.0.0","should":"~2.0.1"},"version":"0.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"},"readmeFilename":"readme.md","_id":"staged-git-files@0.0.1","dist":{"shasum":"2008142c1b0ebdaf06a061b36e34da3db2186895","size":3212,"noattachment":false,"key":"/staged-git-files/-/staged-git-files-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/staged-git-files/download/staged-git-files-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"},"maintainers":[{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"}],"publish_time":1381983797523,"_cnpm_publish_time":1381983797523,"_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* filter: string of git status codes. No spaces\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\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","_attachments":{},"homepage":"https://github.com/mcwhittemore/staged-git-files#readme","bugs":{"url":"https://github.com/mcwhittemore/staged-git-files/issues"},"license":"BSD-2-Clause"}