{"id":28961560,"url":"https://github.com/vipulpathak113/ast-learning","last_synced_at":"2026-05-08T14:46:32.587Z","repository":{"id":295465802,"uuid":"990167620","full_name":"vipulpathak113/ast-learning","owner":"vipulpathak113","description":"Repo for Abstract Syntax Tree for usage in babel, eslint, etc","archived":false,"fork":false,"pushed_at":"2025-07-28T18:21:12.000Z","size":152,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-28T20:28:15.167Z","etag":null,"topics":["abstract-syntax-tree","ast","babel","custom-plugins","eslint","javascript"],"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/vipulpathak113.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,"zenodo":null}},"created_at":"2025-05-25T16:32:12.000Z","updated_at":"2025-07-28T18:21:16.000Z","dependencies_parsed_at":"2025-05-25T18:41:57.641Z","dependency_job_id":"dc2350c2-c82e-4273-9213-a5f38b9394b9","html_url":"https://github.com/vipulpathak113/ast-learning","commit_stats":null,"previous_names":["vipulpathak113/ast-learning"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vipulpathak113/ast-learning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vipulpathak113%2Fast-learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vipulpathak113%2Fast-learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vipulpathak113%2Fast-learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vipulpathak113%2Fast-learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vipulpathak113","download_url":"https://codeload.github.com/vipulpathak113/ast-learning/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vipulpathak113%2Fast-learning/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32785393,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["abstract-syntax-tree","ast","babel","custom-plugins","eslint","javascript"],"created_at":"2025-06-24T02:03:56.847Z","updated_at":"2026-05-08T14:46:32.578Z","avatar_url":"https://github.com/vipulpathak113.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Abstract Syntax Tree (AST) \u0026 Babel Learning\n\n## What is Babel?\nBabel is a powerful JavaScript compiler that\n- Transforms modern JavaScript (ES6+) into backwards compatible code\n- Enables JSX transformation for React\n- Allows custom code transformations through plugins\n- Provides polyfills for new JavaScript features\n\n## Understanding AST\nAn Abstract Syntax Tree (AST) represents the syntactic structure of source code in a tree format. Each node in the tree represents a construct in the source code.\n\n### Babel's Three-Stage Process\n1. **Parse**: Convert source code into AST\n2. **Transform**: Modify AST using plugins/presets\n3. **Generate**: Convert modified AST back to code\n\n## Getting Started\n\n### Installation\n```bash\n# Install core dependencies\nnpm install --save-dev @babel/core @babel/cli babel-loader\nnpm install --save-dev @babel/preset-env\n```\n\n### Custom Plugin Development\n```javascript\nmodule.exports = function (babel) {\n  const { types: t } = babel;\n  \n  return {\n    name: \"my-custom-plugin\",\n    visitor: {\n      // Your transformations here\n    }\n  };\n};\n```\n\n### Example: Console Logger Plugin\nThis plugin adds function names to console calls.\n\nInput:\n```javascript\nfunction test() {\n    console.log(\"Hello\");\n}\n```\n\nOutput:\n```javascript\nfunction test() {\n    console.log(\"called inside 'test'\", \"Hello\");\n}\n```\n\n## Configuration\n\n### Webpack Setup\n```javascript\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        exclude: /node_modules/,\n        use: {\n          loader: 'babel-loader',\n          options: {\n            presets: ['@babel/preset-env'],\n            plugins: ['./custom-scripts/babel']\n          }\n        }\n      }\n    ]\n  }\n};\n```\n\n## Development Tools\n\n### AST Explorer\nVisit [AST Explorer](https://astexplorer.net/) to:\n- Visualize AST structure\n- Test transformations\n- Debug plugin logic\n\n### Common Babel APIs\n- `@babel/core`: Main transformation engine\n- `@babel/types`: AST node utilities\n- `@babel/traverse`: AST traversal\n- `@babel/generator`: Code generation\n\n## Running the Project\n\n```bash\n# Start development server\nnpm start\n\n# Build for production\nnpm run build\n```\n\n## Resources\n- [Babel Documentation](https://babeljs.io/docs/en/)\n- [AST Explorer](https://astexplorer.net/)\n- [Babel Plugin Handbook](https://github.com/jamiebuilds/babel-handbook/blob/master/translations/en/plugin-handbook.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvipulpathak113%2Fast-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvipulpathak113%2Fast-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvipulpathak113%2Fast-learning/lists"}