A simple Node.js script that downloads and cleans CodePen HTML files, also removing unnecessary <canvas>
elements while keeping Three.js functionality intact.
-
Clone the repository
git clone https://github.com/adevra/Codepen-Downloader.git cd codepen-downloader
-
Install dependencies
npm install
Run the script and enter the CodePen URL when prompted:
node download.js
OR provide the URL directly:
node download.js "https://codepen.io/username/pen/id"
The cleaned HTML file will be saved as:
cleaned_codepen.html
Open it in a browser to see the saved CodePen.
- If
puppeteer-extra
fails to install, run:npm install puppeteer puppeteer-core [email protected] puppeteer-extra-plugin-stealth jsdom
- If Node.js shows a module warning, add
"type": "module"
topackage.json
.
MIT License – Free to use and modify.