{"id":15882321,"url":"https://github.com/ph1p/babel-plugin-p5-push-pop","last_synced_at":"2026-01-19T08:31:47.634Z","repository":{"id":40756954,"uuid":"278689459","full_name":"ph1p/babel-plugin-p5-push-pop","owner":"ph1p","description":"This babel plugin provides you a way to organize your P5 code. It replaces no labeled block statements with push(); and pop();","archived":false,"fork":false,"pushed_at":"2023-01-06T11:14:23.000Z","size":1242,"stargazers_count":1,"open_issues_count":21,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T06:34:15.276Z","etag":null,"topics":["babel","babel-plugin","p5","p5js"],"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/ph1p.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}},"created_at":"2020-07-10T17:04:33.000Z","updated_at":"2020-07-13T10:54:38.000Z","dependencies_parsed_at":"2023-02-05T23:02:33.980Z","dependency_job_id":null,"html_url":"https://github.com/ph1p/babel-plugin-p5-push-pop","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ph1p%2Fbabel-plugin-p5-push-pop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ph1p%2Fbabel-plugin-p5-push-pop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ph1p%2Fbabel-plugin-p5-push-pop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ph1p%2Fbabel-plugin-p5-push-pop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ph1p","download_url":"https://codeload.github.com/ph1p/babel-plugin-p5-push-pop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247675619,"owners_count":20977376,"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":["babel","babel-plugin","p5","p5js"],"created_at":"2024-10-06T04:02:29.952Z","updated_at":"2026-01-19T08:31:47.628Z","avatar_url":"https://github.com/ph1p.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-plugin-p5-push-pop\n\nThis babel plugin provides you a way to organize your P5 code.\nIt replaces no labeled block statements with `push` and `pop`.\n\nYes, all scopes of the block statements are not considered because they are replaced. But I think it is bearable, because this spelling is rather less used.\n\nThe advantage is less writing work and now you can fold and indent these blocks\nautomatically within your IDE.\n\nyou can now write this:\n\n```javascript\nfunction setup() {\n  ellipse(0, 50, 33, 33);\n\n  {\n    strokeWeight(10);\n    fill(204, 153, 0);\n    ellipse(33, 50, 33, 33);\n\n    {\n      stroke(0, 102, 153);\n      ellipse(66, 50, 33, 33);\n    }\n  }\n\n  ellipse(100, 50, 33, 33);\n}\n```\n\ninstead of:\n\n```javascript\nfunction setup() {\n  ellipse(0, 50, 33, 33);\n\n  push();\n  strokeWeight(10);\n  fill(204, 153, 0);\n  ellipse(33, 50, 33, 33);\n\n  push();\n  stroke(0, 102, 153);\n  ellipse(66, 50, 33, 33);\n  pop();\n  pop();\n\n  ellipse(100, 50, 33, 33);\n}\n```\n\n## How to use\n\n```bash\nyarn add -D babel-plugin-p5-push-pop\n# or\nnpm install -D babel-plugin-p5-push-pop\n```\n\n**.babelrc**\n\n```json\n{\n  \"presets\": [\"@babel/env\"],\n  \"plugins\": [\"p5-push-pop\"]\n}\n```\n\n## Example\n\nYou can find a fully working example inside `./example`.\nJust run `npm install` and `npm start` or `npm build`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fph1p%2Fbabel-plugin-p5-push-pop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fph1p%2Fbabel-plugin-p5-push-pop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fph1p%2Fbabel-plugin-p5-push-pop/lists"}