🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@samhammer/ckeditor5-simple-image-upload-plugin

Package Overview
Dependencies
Maintainers
8
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@samhammer/ckeditor5-simple-image-upload-plugin

[![npm version](https://badge.fury.io/js/%40samhammer%2Fckeditor5-simple-image-upload-plugin.svg)](https://www.npmjs.com/package/@samhammer/ckeditor5-simple-image-upload-plugin)

latest
Source
npmnpm
Version
3.22.0
Version published
Maintainers
8
Created
Source

ckeditor5-simple-image-upload-plugin

npm version

A generic ckeditor plugin to upload images with a custom api backend.

Features

  • Simple UploadAdapter to upload files with a custom backend.

How to use

To be able to use this plugin you need a custom build of ckeditor.

Further instructions can be found here: https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/installing-plugins.html

Installation:

npm i @samhammer/ckeditor5-simple-image-upload-plugin

Configuration

This plugin uses a hook which can be configured like shown below. This hook is called with the JS-File-Object as parameter and has to return a Promise which resolves to the full URL of the uploaded image.

Example:

InlineEditor
	.create( editorElement, {
        simpleImageUpload: {
            onUpload: file => {
                // do any upload stuff here with the JS-File-Object
                return Promise.resolve("http://path/to/the/uploaded/image.jpg");
            },
            onAbort: () => { // OPTIONAL
                // abort the upload here. The promise from onImageUpload should be rejected after that.
            }
        }
	} )
	.then( ... )
	.catch( ... );

How to publish

For publishing an npm account that is referenced to the organization is required.

See the following how to:

https://docs.npmjs.com/getting-started/publishing-npm-packages

If everything is configured correctly just count up the version number in our package.json and execute one of the following commands:

npm publish --access public

License

ckeditor5-simple-image-upload-plugin is released under the MIT License. See LICENSE file for details.

FAQs

Package last updated on 17 Apr 2023

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