{"id":15383247,"url":"https://github.com/yuanchuan/codepen-prefill","last_synced_at":"2025-04-15T17:32:01.148Z","repository":{"id":57169974,"uuid":"300156267","full_name":"yuanchuan/codepen-prefill","owner":"yuanchuan","description":"Create new pen from local HTML/JS/CSS files with ease","archived":false,"fork":false,"pushed_at":"2020-11-25T08:53:02.000Z","size":28,"stargazers_count":74,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T10:18:44.435Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/yuanchuan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-01T05:28:18.000Z","updated_at":"2025-01-16T06:16:30.000Z","dependencies_parsed_at":"2022-08-27T13:11:54.990Z","dependency_job_id":null,"html_url":"https://github.com/yuanchuan/codepen-prefill","commit_stats":null,"previous_names":["yuanchuan/codepen-cli"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuanchuan%2Fcodepen-prefill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuanchuan%2Fcodepen-prefill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuanchuan%2Fcodepen-prefill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuanchuan%2Fcodepen-prefill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuanchuan","download_url":"https://codeload.github.com/yuanchuan/codepen-prefill/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249118737,"owners_count":21215613,"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":[],"created_at":"2024-10-01T14:36:36.267Z","updated_at":"2025-04-15T17:32:00.899Z","avatar_url":"https://github.com/yuanchuan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# codepen-prefill\n\nThe live editor of [CodePen](https://codepen.io/) is not stable for me most of the time due to the network (in China...), so I always write demos on my local machine first,\nthen open CodePen afterwards and copy/paste into the editor.\n\nThis tool is for saving this process by doing the following steps:\n\n1. Extract *external* or *embedded* **scripts** and **styles** from a local HTML file.\n2. Open a new CodePen editor with default browser.\n3. Prefill each HTML/JS/CSS section and external depencencies in the editor automatically.\n\nThe rest is to click the **SAVE** button.\n\n## Installation\n\n```bash\n$ npm install -g codepen-prefill\n```\n\n## Example\n\n```bash\n$ codepen-prefill index.html\n```\n\nIt can be used to preview a `markdown` file quickly on CodePen:\n\n```bash\n$ codepen-prefill README.md\n```\n\nEdit a JS file on CodePen:\n\n```bash\n$ codepen-prefill example.js\n```\nUsing [npx](https://blog.npmjs.org/post/162869356040/introducing-npx-an-npm-package-runner) which is a package runner bundled in `npm`:\n\n```bash\n$ npx codepen-prefill index.html\n```\n\n## Options\n\n#### --keep-embedded, --embed\n\nBy default all the **embedded** scripts/styles in HTML will be put into JS/CSS sections seperatly,\nbut they can stay with HTML using `--keep-embedded` or `--embed` option.\n\n#### --data\n\nOutput the prefiled data instead of open CodePen.\n\n\n## References\n\n[https://blog.codepen.io/documentation/prefill](https://blog.codepen.io/documentation/prefill/)\n\n\n## Usage\n\n```\nUsage:\n  codepen-prefill \u003cfilename\u003e\n\nOptions:\n  --keep-embedded: Keep embedded styles/scripts inside html (alias: --embed)\n  --data:          Output the prefilled data\n  --help:          Display help info\n\nSupported filename types by extension:\n  htm, html, md, markdown, js, ts, css, less, sass, scss, styl\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuanchuan%2Fcodepen-prefill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuanchuan%2Fcodepen-prefill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuanchuan%2Fcodepen-prefill/lists"}