{"id":17117331,"url":"https://github.com/tdurieux/dinghy","last_synced_at":"2025-04-13T04:31:49.363Z","repository":{"id":65659238,"uuid":"580676580","full_name":"tdurieux/Dinghy","owner":"tdurieux","description":"A library to parse and manipulate Dockerfiles","archived":false,"fork":false,"pushed_at":"2024-09-24T08:02:11.000Z","size":3300,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T21:22:43.155Z","etag":null,"topics":["ast","dockerfile","parser"],"latest_commit_sha":null,"homepage":"https://durieux.me/Dinghy/","language":"TypeScript","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/tdurieux.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-12-21T06:49:51.000Z","updated_at":"2024-09-27T11:25:09.000Z","dependencies_parsed_at":"2023-11-15T17:36:53.320Z","dependency_job_id":"7b21f4db-0d8b-4db4-85af-3bf4add89b9a","html_url":"https://github.com/tdurieux/Dinghy","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdurieux%2FDinghy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdurieux%2FDinghy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdurieux%2FDinghy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdurieux%2FDinghy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tdurieux","download_url":"https://codeload.github.com/tdurieux/Dinghy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248663433,"owners_count":21141764,"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":["ast","dockerfile","parser"],"created_at":"2024-10-14T17:51:18.314Z","updated_at":"2025-04-13T04:31:49.333Z","avatar_url":"https://github.com/tdurieux.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Dinghy: Versatile AST Generator for Shell Scripts and Dockerfiles**\n\n[![CI](https://github.com/tdurieux/Dinghy/actions/workflows/build-test.yml/badge.svg)](https://github.com/tdurieux/Dinghy/actions/workflows/build-test.yml) ![NPM Version](https://img.shields.io/npm/v/%40tdurieux%2Fdinghy)\n\nDinghy is a robust library designed to generate Abstract Syntax Trees (ASTs) for both shell scripts and Dockerfiles. It offers developers a solution for parsing and analyzing these files, facilitating advanced automation and analysis tasks.\n\nFor detailed documentation, please visit [https://durieux.me/Dinghy/](https://durieux.me/Dinghy/).\n\n## Features\n\n- **AST Generation**: Effortlessly generate ASTs for shell scripts and Dockerfiles.\n- **Parsing**: Accurately parse complex Dockerfiles, capturing their structure and directives.\n- **Traversal**: Traverse the AST to perform various analysis tasks such as linting or modification.\n- **Querying**: Extract specific information about commands, arguments, and more with ease.\n- **Modular Design**: Built with modularity in mind, enabling easy extension and customization.\n- **TypeScript Support**: Fully compatible with TypeScript for type-safe development.\n\n## Installation\n\n```bash\nnpm install @tdurieux/dinghy\n```\n\n## Usage\n\n```typescript\nimport dinghy from \"@tdurieux/dinghy\";\n\n// Parse Dockerfile\nconst dockerAST = dinghy.parseDocker(/* file path or file content */);\ndockerAST.traverse((node) =\u003e {\n  if (node instanceof dinghy.AbstractValueNode) {\n    console.log(node.value);\n  }\n});\n\n// Parse Shell Script\nconst shellAST = dinghy.parseShell(/* file path or file content */);\nshellAST.traverse((node) =\u003e {\n  if (node instanceof dinghy.AbstractValueNode) {\n    console.log(node.value);\n  }\n});\n```\n\nAdditional examples are available in the library's test suite.\n\n## Contributing\n\nContributions to Dinghy are welcome! Whether it's bug fixes, new features, or documentation improvements, feel free to submit pull requests on our GitHub repository.\n\n## License\n\nDinghy is licensed under the MIT License. See the LICENSE file for details.\n\n**Happy Coding with Dinghy!**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdurieux%2Fdinghy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftdurieux%2Fdinghy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdurieux%2Fdinghy/lists"}