{"id":19783805,"url":"https://github.com/magicien/undo-canvas","last_synced_at":"2025-10-24T04:57:47.248Z","repository":{"id":57385940,"uuid":"102308743","full_name":"magicien/undo-canvas","owner":"magicien","description":"Add undo/redo functions to CanvasRenderingContext2D","archived":false,"fork":false,"pushed_at":"2019-10-29T03:19:49.000Z","size":19,"stargazers_count":36,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-28T22:43:49.896Z","etag":null,"topics":["canvas","canvasrenderingcontext2d","undo-redo"],"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/magicien.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["magicien"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2017-09-04T02:06:26.000Z","updated_at":"2024-09-02T18:03:09.000Z","dependencies_parsed_at":"2022-08-31T14:30:16.123Z","dependency_job_id":null,"html_url":"https://github.com/magicien/undo-canvas","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicien%2Fundo-canvas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicien%2Fundo-canvas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicien%2Fundo-canvas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicien%2Fundo-canvas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magicien","download_url":"https://codeload.github.com/magicien/undo-canvas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224225206,"owners_count":17276435,"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":["canvas","canvasrenderingcontext2d","undo-redo"],"created_at":"2024-11-12T06:09:17.942Z","updated_at":"2025-10-24T04:57:47.178Z","avatar_url":"https://github.com/magicien.png","language":"JavaScript","funding_links":["https://github.com/sponsors/magicien"],"categories":[],"sub_categories":[],"readme":"# undo-canvas\nAdd undo/redo functions to CanvasRenderingContext2D\n\n[Online Demo 1](https://magicien.github.io/undo-canvas/demo.html) / [Demo 2](https://magicien.github.io/undo-canvas/demo2.html)\n\n```\n\u003cscript src=\"https://cdn.rawgit.com/magicien/undo-canvas/v0.1.3/undo-canvas.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nconst canvas = document.createElement('canvas')\nconst context = canvas.getContext('2d')\nUndoCanvas.enableUndo(context)\n\ncontext.strokeStyle = '#ff0000'\ncontext.beginPath()\ncontext.moveTo(0, 0)\ncontext.lineTo(30, 30)\ncontext.closePath()\ncontext.stroke()\n\ncontext.undo() // erase the line\n\ncontext.redo() // redraw the line\n\nUndoCanvas.disableUndo(context)\n\u003c/script\u003e\n```\n\n## Install\n\n### Node\n```\nnpm install --save undo-canvas\n```\n\n### Browser\n```\n\u003cscript src=\"https://cdn.rawgit.com/magicien/undo-canvas/v0.1.3/undo-canvas.js\"\u003e\u003c/script\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicien%2Fundo-canvas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagicien%2Fundo-canvas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicien%2Fundo-canvas/lists"}