New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@acarl005/codeflask

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@acarl005/codeflask

A micro code-editor for awesome web pages

  • 2.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

CodeFlask Mod

npm i '@acarl005/codeflask'

I modified CodeFlask to be able to...

  1. Make PrismJS a peer dependency
  2. Attach (and remove) custom event listeners to the editor
  3. Support the Line Highlight plugin in PrismJS
  4. Fix this issue: kazzkiq/CodeFlask#69
  5. Fix bugs with tab hotkey for indentation
  6. Make the self-closing characters configurable
import CodeFlask from "codeflask"
import Prism from "prismjs"

const flask = new CodeFlask(editor, Prism, {
  language: "js",
  selfClosingCharacters: ['(', '[', '{', "'", '"'],
  customEventListeners: {
    "keydown": e => {
      if (e.key == "Enter") {
        e.preventDefault()
        e.stopImmediatePropagation()
        // do custom stuff
      }
    }
  }
})

flask.highlightLines("4-7")

PrismJS is highly customizable. It actually offers custom builds with more plugins that you can opt into. This is an awesome and rare feature b/c you can minimize the bundle by omitting unneeded functionality. Therefore, it should be a peer dependency, b/c CodeFlask can't know which build with which plugins you'll need.

Keywords

FAQs

Package last updated on 16 Sep 2022

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