@editorjs/simple-image

中文文档
1.6.0发布于 2023/11/14MITESM + CJS近 30 天下载 17.4万

SimpleImage Tool for Editor.js

原始使用文档
文档目录5 节
  1. Installation
  2. Usage
  3. Config Params
  4. Tool's settings
  5. Output data

Simple Image Tool

Provides Image Blocks for the Editor.js.

Works only with pasted image URLs and requires no server-side uploader.

Installation

Get the package

yarn add @editorjs/simple-image

Include module at your application

import SimpleImage from "@editorjs/simple-image";

Optionally, you can load this tool from CDN JsDelivr CDN

Usage

Add a new Tool to the tools property of the Editor.js initial config.

var editor = EditorJS({
  ...

  tools: {
    ...
    image: SimpleImage,
  }

  ...
});

Config Params

This Tool has no config params

Tool's settings

  1. Add border

  2. Stretch to full-width

  3. Add background

Output data

FieldTypeDescription
urlstringimage's url
captionstringimage's caption
withBorderbooleanadd border to image
withBackgroundbooleanneed to add background
stretchedbooleanstretch image to screen's width
{
  "type": "image",
  "data": {
    "url": "https://www.tesla.com/tesla_theme/assets/img/_vehicle_redesign/roadster_and_semi/roadster/hero.jpg",
    "caption": "Roadster // tesla.com",
    "withBorder": false,
    "withBackground": false,
    "stretched": true
  }
}

版本与发布记录

@editorjs/simple-image 共发布 9 个版本,首次发布于 2019/03/03;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.6.0latest2023/11/142 年前
1.5.12022/12/053 年前
1.5.02022/11/303 年前
1.4.12021/03/235 年前
1.4.02020/09/306 年前
1.3.32019/10/037 年前

关于 @editorjs/simple-image 的常见问题

@editorjs/simple-image 是什么?

SimpleImage Tool for Editor.js

如何安装 @editorjs/simple-image?

在项目目录运行 npm install @editorjs/simple-image,或使用 pnpm add / yarn add / bun add。

@editorjs/simple-image 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/editorjs__simple-image 是否存在。

@editorjs/simple-image 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@editorjs/simple-image 可以商用吗?

@editorjs/simple-image 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@editorjs/simple-image 的下载量有多少?

根据 npm 官方下载统计,@editorjs/simple-image 在 2026/10/13 – 2026/11/11 这 30 天内被下载 173,517 次,日均约 5,784 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@editorjs/simple-image 还在维护吗?

最新版本 1.6.0 发布于 2023/11/14(2 年前);至今共发布 9 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/03/03。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。