{"id":24455617,"url":"https://github.com/putoutjs/git-status-porcelain","last_synced_at":"2025-10-01T17:30:58.814Z","repository":{"id":57138499,"uuid":"210401517","full_name":"putoutjs/git-status-porcelain","owner":"putoutjs","description":"🏺Parse git status --porcelain output with a pleasure.","archived":false,"fork":false,"pushed_at":"2024-05-21T09:46:03.000Z","size":27,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-12T22:35:39.414Z","etag":null,"topics":["git","javascript","nodejs","porcelain","status"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/putoutjs.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-23T16:23:19.000Z","updated_at":"2024-05-21T09:46:06.000Z","dependencies_parsed_at":"2024-06-18T21:31:59.956Z","dependency_job_id":"b1b90073-837a-400f-8640-bb39d275ed1a","html_url":"https://github.com/putoutjs/git-status-porcelain","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putoutjs%2Fgit-status-porcelain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putoutjs%2Fgit-status-porcelain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putoutjs%2Fgit-status-porcelain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putoutjs%2Fgit-status-porcelain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/putoutjs","download_url":"https://codeload.github.com/putoutjs/git-status-porcelain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234883274,"owners_count":18901366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","javascript","nodejs","porcelain","status"],"created_at":"2025-01-21T02:13:58.638Z","updated_at":"2025-10-01T17:30:58.466Z","avatar_url":"https://github.com/putoutjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Porcelain [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage][CoverageIMGURL]][CoverageURL]\n\n[NPMURL]: https://npmjs.org/package/@putout/git-status-porcelain \"npm\"\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/git-status-porcelain.svg?style=flat\u0026longCache=true\n[BuildStatusURL]: https://github.com/putoutjs/git-status-porcelain/actions?query=workflow%3A%22Node+CI%22 \"Build Status\"\n[BuildStatusIMGURL]: https://github.com/putoutjs/git-status-porcelain/workflows/Node%20CI/badge.svg\n[LicenseURL]: https://tldrlegal.com/license/mit-license \"MIT License\"\n[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat\u0026longCache=true\n[CoverageURL]: https://coveralls.io/github/coderaiser/git-status-porcelain?branch=master\n[CoverageIMGURL]: https://coveralls.io/repos/coderaiser/git-status-porcelain/badge.svg?branch=master\u0026service=github\n\nParse `git status --porcelain` output with a pleasure.\n\n## Install\n\n```\nnpm i @putout/git-status-porcelain\n```\n\n## How to use?\n\n`porcelain` can be used in simpified mode, when you just need names of modified files (`added`, `deleted`, works as well):\n\n```js\nconst porcelain = require('@putout/git-status-porcelain');\n\nporcelain({\n    modified: true,\n    untracked: true,\n});\n\n// returns\n[\n    'README.md',\n    '1.js',\n];\n```\n\nBut you can break `porcelain` into pieces as well 😉:\n\n```js\nconst porcelain = require('@putout/git-status-porcelain');\n\nconst {\n    run,\n    parse,\n    pick,\n    getNames,\n} = porcelain;\n\n// run 'git status --porcelain'\nconst stdout = run();\n\n// returns\n' M README.md\\n?? 1.js\\n';\n\nconst files = parse(stdout);\n\n// returns\n[{\n    name: 'README.md',\n    mode: ' M ',\n}, {\n    name: '1.js',\n    mode: '?',\n}];\n\nconst modifiedFiles = pick(files, {\n    modified: true,\n    untracked: false,\n    deleted: false,\n    added: false,\n    renamed: false,\n    unstaged: false,\n});\n\n// returns\n[{\n    name: 'README.md',\n    mode: ' M ',\n}];\n\ngetNames(modifiedFiles);\n// returns\n['README.md'];\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fputoutjs%2Fgit-status-porcelain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fputoutjs%2Fgit-status-porcelain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fputoutjs%2Fgit-status-porcelain/lists"}