npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

ckeditor5-custom-image-upload-adapter

v1.0.1

Published

A convenient function to create a custom-image-upload-adapter for ckeditor5

Downloads

1

Readme

CKEditor5 Custom Image Upload Adapter

A custom image upload adapter for CKEditor 5, allowing you to integrate your own file upload handler with additional options and callbacks.

Installation

# npm
npm install --save ckeditor5-custom-image-upload-adapter

# yarn
yarn add ckeditor5-custom-image-upload-adapter

# pnpm
pnpm add ckeditor5-custom-image-upload-adapter

Usage

First, import the createCustomImageUploadAdapter function:

import { createCustomImageUploadAdapter } from 'ckeditor5-custom-image-upload-adapter';

Then, use the function to configure the image upload adapter for your CKEditor instance:

  extraPlugins: [
    createCustomImageUploadAdapter(async function onSendRequest(file: File) {
      // send file to server
      // then return a url of the image
      return 'https://picsum.photos/200/300'
    })
  ]

Explanation

The createCustomImageUploadAdapter function takes two parameters: onSendRequest and options. The onSendRequest parameter is a required callback function that handles the image upload request to the server and returns a Promise that resolves with the URL of the uploaded image. The options parameter is an optional object that can be used to configure the behavior of the custom image upload adapter.

The options parameter has the following properties:

  • defaultErrorMessageFactory: A function that takes a file name as a parameter and returns a string that represents the default error message if the image upload fails. This property is optional.
  • onSendRequestFailure: A callback function that takes an error object as a parameter and is called if the onSendRequest function throws an error. This property is optional.
  • onUpload: A callback function that takes a File object as a parameter and is called when the file upload starts. This property is optional.

Testing

The package is tested with both unit tests (/test) and e2e tests (/e2e).

To run the e2e tests, you must first build the e2e src:

npm run build:e2e

Then, run the e2e tests:

npm run test:e2e