Gathering detailed insights and metrics for react-quill-image-uploader
Gathering detailed insights and metrics for react-quill-image-uploader
Gathering detailed insights and metrics for react-quill-image-uploader
Gathering detailed insights and metrics for react-quill-image-uploader
a plugin for react-quill which can upload multi image and remember the image url histroy
npm install react-quill-image-uploader
Typescript
Module System
Min. Node Version
Node Version
NPM Version
72.4
Supply Chain
97
Quality
75.4
Maintenance
100
Vulnerability
100
License
JavaScript (81.68%)
CSS (18.32%)
Total Downloads
34,488
Last Day
8
Last Week
77
Last Month
402
Last Year
5,561
MIT License
5 Stars
16 Commits
2 Forks
1 Watchers
7 Branches
1 Contributors
Updated on Jul 08, 2021
Minified
Minified + Gzipped
Latest Version
0.1.1
Package Id
react-quill-image-uploader@0.1.1
Unpacked Size
222.51 kB
Size
81.30 kB
File Count
14
NPM Version
6.9.0
Node Version
10.16.0
Cumulative downloads
Total Downloads
Last Day
-11.1%
8
Compared to previous day
Last Week
-17.2%
77
Compared to previous week
Last Month
-25.4%
402
Compared to previous month
Last Year
-16.4%
5,561
Compared to previous year
2
20
a plugin for react-quill which can upload multi image and remember the image url histroy
1npm i react-quill-image-uploader 2// yarn add react-quill-image-uploader
1import ReactQuill from 'react-quill' 2import 'react-quill/dist/quill.snow.css' 3import ReactQuillImageUploader, { 4 saveImageSrc, 5} from 'react-quill-image-uploader' 6 7class App extends React.Component { 8 modules = { 9 toolbar: { 10 container: [['bold', 'italic', 'underline', 'strike'], ['image']], 11 handlers: { 12 image: () => { 13 const { clientX, y: clientY } = window.event 14 const position = { x: clientX, y: clientY } // position the plugin to show 15 this.ReactQuillImageUploaderRef.toggle(position) // show or hide the plugin 16 // toggle() is also ok 17 // this.ReactQuillImageUploaderRef.toggle() 18 }, 19 }, 20 }, 21 } 22 componentDidMount() { 23 this.quill = this.quillRef.getEditor() 24 this.setState({ quill: this.quill }) 25 26 // add new one to history 27 // from version 0.0.1 28 // ReactQuillImageUploader.saveImageSrc("https://iph.href.lu/100x100") 29 // from version 0.0.4 30 ReactQuillImageUploader.saveImage({ 31 name: 'demo.jpg', 32 src: 'https://iph.href.lu/100x100', 33 }) 34 35 // remove all and add new one by the history api 36 37 // es6 38 // import {setHistory} from 'react-quill-image-uploader' 39 // setHistory([{ 40 // name: "demo.jpg", 41 // src: "https://iph.href.lu/100x100" 42 // }]) 43 44 // es5 45 // ReactQuillImageUploader.setHistory([{ 46 // name: "demo.jpg", 47 // src: "https://iph.href.lu/100x100" 48 // }]) 49 } 50 51 uploadImageCallBack = (file, base64) => { 52 // check file.size 53 // check file type by file.name 54 55 return new Promise((resolve, reject) => { 56 // submit file to server 57 let src = 'https://iph.href.lu/200x200' // demo image src 58 if (base64) { 59 src = base64 60 } 61 // upload img thing 62 const uploadSuccess = false 63 if (uploadSuccess) { 64 // insert img into editor manually 65 this.ReactQuillImageUploaderRef.insertImg(src) 66 67 // return data to save to plugin history 68 resolve({ 69 data: { 70 name: file.name || '', 71 link: src, 72 }, 73 }) 74 } else if (!uploadSuccess) { 75 // return resolve({status: 'fail'}) or reject(), plugin will warn the user to upload again, will not save in history 76 // resolve({ 77 // status: 'fail', 78 // }) 79 // resolve() 80 // or 81 setTimeout(() => { 82 return reject() 83 }, 3 * 1000) 84 } else { 85 // return nothing, meaning that do not save anything to history or upload fail panel 86 resolve() 87 } 88 }) 89 } 90 render() { 91 const { modules, className = '', placeholder = 'write here..' } = this.props 92 const { quill = {} } = this.state 93 return ( 94 <div> 95 <ReactQuill 96 ref={el => { 97 this.quillRef = el 98 }} 99 placeholder={placeholder} 100 modules={modules || this.modules} 101 className={className} 102 /> 103 <ReactQuillImageUploader 104 ref={el => { 105 this.ReactQuillImageUploaderRef = el 106 }} 107 isShowUploadFail={true} // default true, uopload fail history is hidden when false 108 isShowHistory={true} // default true, history is hidden when false 109 quill={this.state.quill} 110 uploadCallback={uploadImageCallBack} 111 /> 112 </div> 113 ) 114 } 115}
reject()
as well as resolve({status: 'fail'})
uploadCallback can return nothing
, like audio and videosaveImage
, add public method insertImg
for inserting img by hand。No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/16 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
66 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More