Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

codepen-prefill

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codepen-prefill

Create new pen from local HTML/JS/CSS files with ease

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

codepen-prefill

The live editor of CodePen 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, then open CodePen afterwards and copy/paste into the editor.

This tool is for saving this process by doing the following steps:

  1. Extract external or embedded scripts and styles from a local HTML file.
  2. Open a new CodePen editor with default browser.
  3. Prefill each HTML/JS/CSS section and external depencencies in the editor automatically.

The rest is to click the SAVE button.

Installation

$ npm install -g codepen-prefill

Example

$ codepen-prefill index.html

It can be used to preview a markdown file quickly on CodePen:

$ codepen-prefill README.md

Edit a JS file on CodePen:

$ codepen-prefill example.js

Using npx which is a package runner bundled in npm:

$ npx codepen-prefill index.html

Options

--keep-embedded, --embed

By default all the embedded scripts/styles in HTML will be put into JS/CSS sections seperatly, but they can stay with HTML using --keep-embedded or --embed option.

--data

Output the prefiled data instead of open CodePen.

References

https://blog.codepen.io/documentation/prefill

Usage

Usage:
  codepen-prefill <filename>

Options:
  --keep-embedded: Keep embedded styles/scripts inside html (alias: --embed)
  --data:          Output the prefilled data
  --help:          Display help info

Supported filename types by extension:
  htm, html, md, markdown, js, ts, css, less, sass, scss, styl

FAQs

Package last updated on 25 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc