Skip to content

EastSun5566/inline-attacher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

58 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“Ž Inline Attacher (WIP)

NPM Version NPM Downloads License

A modern port of Inline Attachment

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,
    });