Gathering detailed insights and metrics for jodit
Gathering detailed insights and metrics for jodit
Gathering detailed insights and metrics for jodit
Gathering detailed insights and metrics for jodit
npm install jodit
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1,713 Stars
2,953 Commits
354 Forks
54 Watching
23 Branches
67 Contributors
Updated on 25 Nov 2024
Minified
Minified + Gzipped
TypeScript (49.47%)
JavaScript (46.15%)
Less (3.51%)
HTML (0.39%)
Makefile (0.36%)
Dockerfile (0.05%)
CSS (0.04%)
Shell (0.02%)
Cumulative downloads
Total Downloads
Last day
-2.3%
15,160
Compared to previous day
Last week
2.6%
83,345
Compared to previous week
Last month
9%
349,093
Compared to previous month
Last year
52.8%
3,409,003
Compared to previous year
1
Jodit Editor is an excellent WYSIWYG editor written in pure TypeScript without the use of additional libraries. It includes a file editor and image editor.
Download the latest release or via npm:
1npm install jodit
You will get the following files:
/esm
: ESM version of the editor (compatible with tools like webpack)/es5
, /es2015
, /es2018
, /es2021
: UMD bundled files (not minified)/es5
, /es2015
, /es2018
, /es2021
with .min.js
extension: UMD bundled and minified filestypes/index.d.ts
: This file specifies the API of the editor. It is versioned, while everything else is considered private and may change with each release.Include the following two files:
1<link type="text/css" rel="stylesheet" href="es2015/jodit.min.css" /> 2<script type="text/javascript" src="es2015/jodit.min.js"></script>
ES2021 Version (for modern browsers only):
1<link type="text/css" rel="stylesheet" href="es2021/jodit.min.css" /> 2<script type="text/javascript" src="es2021/jodit.min.js"></script>
1<script type="importmap"> 2 { 3 "imports": { 4 "autobind-decorator": "https://unpkg.com/autobind-decorator@2.4.0/lib/esm/index.js" 5 } 6 } 7</script> 8<link rel="stylesheet" href="./node_modules/jodit/es2021/jodit.min.css" /> 9<script type="module"> 10 import { Jodit } from './node_modules/jodit/esm/index.js'; 11 Jodit.make('#editor', { 12 width: 600, 13 height: 400 14 }); 15</script>
The ESM modules automatically include only the basic set of plugins and the English language. You can manually include additional plugins and languages as needed.
1<script type="importmap"> 2 { 3 "imports": { 4 "autobind-decorator": "https://unpkg.com/autobind-decorator@2.4.0/lib/esm/index.js" 5 } 6 } 7</script> 8<link rel="stylesheet" href="./node_modules/jodit/es2021/jodit.min.css" /> 9<script type="module"> 10 import { Jodit } from './node_modules/jodit/esm/index.js'; 11 import './node_modules/jodit/esm/plugins/add-new-line/add-new-line.js'; 12 import './node_modules/jodit/esm/plugins/fullsize/fullsize.js'; 13 import de from './node_modules/jodit/esm/langs/de.js'; 14 15 Jodit.langs.de = de; 16 17 Jodit.make('#editor', { 18 width: 600, 19 height: 400, 20 language: 'de' 21 }); 22</script>
1<link 2 rel="stylesheet" 3 href="https://cdnjs.cloudflare.com/ajax/libs/jodit/4.0.1/es2021/jodit.min.css" 4/> 5<script src="https://cdnjs.cloudflare.com/ajax/libs/jodit/4.0.1/es2021/jodit.min.js"></script>
1<link 2 rel="stylesheet" 3 href="https://unpkg.com/jodit@4.0.1/es2021/jodit.min.css" 4/> 5<script src="https://unpkg.com/jodit@4.0.1/es2021/jodit.min.js"></script>
Add a textarea
element to your HTML:
1<textarea id="editor" name="editor"></textarea>
Initialize Jodit on the textarea:
1const editor = Jodit.make('#editor'); 2editor.value = '<p>start</p>';
1Jodit.plugins.yourplugin = function (editor) { 2 editor.events.on('afterInit', function () { 3 editor.s.insertHTMl('Text'); 4 }); 5};
1const editor = Jodit.make('.someselector', { 2 extraButtons: [ 3 { 4 name: 'insertDate', 5 iconURL: 'https://xdsoft.net/jodit/logo.png', 6 exec: function (editor) { 7 editor.s.insertHTML(new Date().toDateString()); 8 editor.synchronizeValues(); // For history saving 9 } 10 } 11 ] 12});
or
1const editor = Jodit.make('.someselector', { 2 buttons: ['bold', 'insertDate'], 3 controls: { 4 insertDate: { 5 name: 'insertDate', 6 iconURL: 'https://xdsoft.net/jodit/logo.png', 7 exec: function (editor) { 8 editor.s.insertHTML(new Date().toDateString()); 9 } 10 } 11 } 12});
button with plugin
1Jodit.plugins.add('insertText', function (editor) { 2 editor.events.on('someEvent', function (text) { 3 editor.s.insertHTMl('Hello ' + text); 4 }); 5}); 6 7// or 8 9Jodit.plugins.add('textLength', { 10 init(editor) { 11 const div = editor.create.div('jodit_div'); 12 editor.container.appendChild(div); 13 editor.events.on('change.textLength', () => { 14 div.innerText = editor.value.length; 15 }); 16 }, 17 destruct(editor) { 18 editor.events.off('change.textLength'); 19 } 20}); 21 22// or use class 23 24Jodit.plugins.add( 25 'textLength', 26 class textLength { 27 init(editor) { 28 const div = editor.create.div('jodit_div'); 29 editor.container.appendChild(div); 30 editor.events.on('change.textLength', () => { 31 div.innerText = editor.value.length; 32 }); 33 } 34 destruct(editor) { 35 editor.events.off('change.textLength'); 36 } 37 } 38); 39 40const editor = Jodit.make('.someselector', { 41 buttons: ['bold', 'insertText'], 42 controls: { 43 insertText: { 44 iconURL: 'https://xdsoft.net/jodit/logo.png', 45 exec: function (editor) { 46 editor.events.fire('someEvent', 'world!!!'); 47 } 48 } 49 } 50});
For testing FileBrowser and Uploader modules, need install PHP Connector
1composer create-project --no-dev jodit/connector
Run test PHP server
1php -S localhost:8181 -t ./
and set options for Jodit:
1const editor = Jodit.make('#editor', { 2 uploader: { 3 url: 'http://localhost:8181/index-test.php?action=fileUpload' 4 }, 5 filebrowser: { 6 ajax: { 7 url: 'http://localhost:8181/index-test.php' 8 } 9 } 10});
MIT
The latest stable version of the package.
Stable Version
2
6.1/10
Summary
Jodit Editor vulnerable to cross-site scripting
Affected Versions
= 4.0.0-beta.86
Patched Versions
6.1/10
Summary
Jodit Editor vulnerable to Cross-site Scripting
Affected Versions
<= 3.24.2
Patched Versions
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 6 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
no SAST tool detected
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2024-11-18
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