Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1.14 KB

README.md

File metadata and controls

40 lines (28 loc) · 1.14 KB

📎 Inline Attacher

NPM Version NPM Downloads License

A modern port of Inline Attachment

🔗 https://eastsun5566.github.io/inline-attacher/

Installation

npm i inline-attacher

Usage

  • Input / Textarea

    import { attach } from "inline-attacher";
    
    const textarea = document.querySelector("textarea");
    attach(textarea, { uploadUrl: "https://example.com/upload" });
  • CodeMirror v6

    import { EditorView } from "codemirror";
    import { inlineAttachmentExtension } from "inline-attacher";
    
    const editor = new EditorView({
      extensions: [
        inlineAttachmentExtension({ uploadUrl: "https://example.com/upload" }),
      ],
      parent: document.body,
    });