Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@ckeditor/ckeditor5-autosave
Advanced tools
@ckeditor/ckeditor5-autosave is a plugin for CKEditor 5 that provides automatic saving functionality. It allows the editor to periodically save the content to a server or local storage, ensuring that no data is lost in case of unexpected events like browser crashes or network issues.
Automatic Save
This feature allows the editor to automatically save the content at regular intervals. The provided code sample demonstrates how to configure the CKEditor 5 with the Autosave plugin and define a custom save function that sends the editor's data to a server endpoint.
const ClassicEditor = require('@ckeditor/ckeditor5-build-classic');
const Autosave = require('@ckeditor/ckeditor5-autosave/src/autosave');
ClassicEditor.create(document.querySelector('#editor'), {
plugins: [ Autosave ],
autosave: {
save( editor ) {
return saveData( editor.getData() );
}
}
})
.catch( error => {
console.error( error );
});
function saveData( data ) {
// Simulate a save request to the server
return fetch( '/save', {
method: 'POST',
body: JSON.stringify( { content: data } ),
headers: {
'Content-Type': 'application/json'
}
});
}
Save on Blur
This feature allows the editor to save the content after a specified period of inactivity. The code sample shows how to configure the Autosave plugin to save the content after 5 seconds of inactivity.
const ClassicEditor = require('@ckeditor/ckeditor5-build-classic');
const Autosave = require('@ckeditor/ckeditor5-autosave/src/autosave');
ClassicEditor.create(document.querySelector('#editor'), {
plugins: [ Autosave ],
autosave: {
waitingTime: 5000, // Save after 5 seconds of inactivity
save( editor ) {
return saveData( editor.getData() );
}
}
})
.catch( error => {
console.error( error );
});
function saveData( data ) {
// Simulate a save request to the server
return fetch( '/save', {
method: 'POST',
body: JSON.stringify( { content: data } ),
headers: {
'Content-Type': 'application/json'
}
});
}
Draft.js is a JavaScript rich text editor framework, built for React. It provides a similar autosave functionality through custom implementations. Unlike @ckeditor/ckeditor5-autosave, Draft.js requires more manual setup and configuration for autosave features.
Quill is a modern WYSIWYG editor built for compatibility and extensibility. It does not have built-in autosave functionality, but similar features can be implemented using Quill's API and event listeners. Compared to @ckeditor/ckeditor5-autosave, Quill requires additional coding to achieve autosave.
TinyMCE is a popular rich text editor that offers a variety of plugins, including an autosave plugin. The autosave plugin in TinyMCE provides similar functionality to @ckeditor/ckeditor5-autosave, allowing content to be saved automatically at regular intervals or on specific events.
This package implements the autosave feature for CKEditor 5.
This plugin is part of the ckeditor5
package. Install the whole package to use it.
npm install ckeditor5
If you want to check full CKEditor 5 capabilities, sign up for a free non-commitment 14-day trial.
Check out the demo in the autosave feature guide.
See the @ckeditor/ckeditor5-autosave
package page in CKEditor 5 documentation.
Licensed under a dual-license model, this software is available under:
For more information, see: https://ckeditor.com/legal/ckeditor-licensing-options.
FAQs
Autosave feature for CKEditor 5.
The npm package @ckeditor/ckeditor5-autosave receives a total of 137,995 weekly downloads. As such, @ckeditor/ckeditor5-autosave popularity was classified as popular.
We found that @ckeditor/ckeditor5-autosave demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.