{"id":19621351,"url":"https://github.com/commenthol/esc-command","last_synced_at":"2025-07-20T07:04:29.904Z","repository":{"id":112196012,"uuid":"609841956","full_name":"commenthol/esc-command","owner":"commenthol","description":"Utility methods to prevent command injection vulnerabilities.","archived":false,"fork":false,"pushed_at":"2023-03-05T12:09:02.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-26T18:53:36.530Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commenthol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-03-05T12:07:13.000Z","updated_at":"2023-03-05T12:09:05.000Z","dependencies_parsed_at":"2023-05-11T06:30:32.887Z","dependency_job_id":null,"html_url":"https://github.com/commenthol/esc-command","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/commenthol/esc-command","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fesc-command","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fesc-command/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fesc-command/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fesc-command/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commenthol","download_url":"https://codeload.github.com/commenthol/esc-command/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fesc-command/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266081239,"owners_count":23873511,"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":[],"created_at":"2024-11-11T11:22:27.758Z","updated_at":"2025-07-20T07:04:29.839Z","avatar_url":"https://github.com/commenthol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esc-command\n\nUtility methods to prevent command injection vulnerabilities.\n\n# usage\n\n## escapeCommand()\n\nEscapes a command or command arguments by operation system\n\n```js\nimport {escapeCommand} from 'esc-command'\nconst dirname = '/usr/bin;\" cat /etc/passwd'\nconst esc = 'ls -1 \"' + escapeCommand(dirname) + '\"'\n// ls -1 \"\\/usr\\/bin\\;\\\" cat \\/etc\\/passwd\"\n```\n\n## escapeCommandLit``\n\nLiteral to escape a command or command arguments by operation system\n\n```js\nimport {escapeCommandLit} from 'esc-command'\nconst dirname = '/usr/bin;\" cat /etc/passwd'\nconst esc = escapeCommandLit`ls -1 \"${dirname}\"`\n// ls -1 \"\\/usr\\/bin\\;\\\" cat \\/etc\\/passwd\"\n```\n\n## filterCommand()\n\nFilters a command or command arguments by operation system\n\n```js\nimport {filterCommand} from 'esc-command'\nconst dirname = '/usr/bin;\" cat /etc/passwd'\nconst esc = 'ls -1 \"' + filterCommand(dirname) + '\"'\n// ls -1 \"\\/usr\\/bin   cat \\/etc\\/passwd\"\n```\n\n## filterCommandLit``\n\nLiteral to filter a command or command arguments by operation system\n\n```js\nimport {filterCommandLit} from 'esc-command'\nconst dirname = '/usr/bin;\" cat /etc/passwd'\nconst esc = filterCommandLit`ls -1 \"${dirname}\"`\n// ls -1 \"\\/usr\\/bin   cat \\/etc\\/passwd\"\n```\n\n## License\n\n[MIT](./LICENSE)\n\n## References\n\n- [Testing for Command Injection][]\n- [Escape Characters, Delimiters and Quotes at the Windows command line][]\n \n[Testing for Command Injection]: https://wiki.owasp.org/index.php/Testing_for_Command_Injection_(OTG-INPVAL-013)#Sanitization\n[Escape Characters, Delimiters and Quotes at the Windows command line]: https://ss64.com/nt/syntax-esc.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fesc-command","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommenthol%2Fesc-command","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fesc-command/lists"}