EastSun5566 / inline-attacher

πŸ“Ž A modern inline attachment

Home Page:https://npm.im/inline-attacher

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ“Ž 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,
    });

About

πŸ“Ž A modern inline attachment

https://npm.im/inline-attacher

License:MIT License


Languages

Language:TypeScript 84.4%Language:CSS 5.9%Language:HTML 5.8%Language:JavaScript 2.6%Language:Shell 1.3%