
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@dearj/core
Advanced tools
The DearJ suite provides a powerful drag-and-drop email editor for modern web applications. With seamless integrations for frameworks like Angular and React, DearJ enables users to easily create and manage dynamic email templates. The suite is built on Unlayer's core technology, ensuring top-tier email design capabilities.
DearJ aims to offer a simple, framework-agnostic solution for embedding email editing functionality with a minimal API and an intuitive interface.
To install DearJ, simply use npm or yarn:
npm install dearj
or
yarn add dearj
To initialize the editor, create an instance of the EmailEditor class and provide the necessary configuration.
import { EmailEditor } from "dearj";
const editor = new EmailEditor({
authorization: "YOUR_AUTHORIZATION_TOKEN",
// other configuration options
});
After initialization, you can mount the email editor inside a container element.
const container = document.getElementById("editor-container");
editor.mount(container);
Once you're done designing, you can export the email design as HTML or JSON.
// Export HTML
editor.exportHtml().then((html) => {
console.log("Exported HTML: ", html);
});
// Export JSON
editor.exportJson().then((json) => {
console.log("Exported JSON: ", json);
});
The EmailEditor class provides several methods to manage the email editor's lifecycle and functionality.
new EmailEditor(config: EditorConfig, design: Template | null = null)
authorization as a string.mount(container: HTMLElement): Mounts the email editor into a specified container element.
unmount(): Removes the editor iframe and cleans up event listeners.
onDesignUpdate(): Returns a Promise that resolves when the email design is updated.
onDesignLoad(): Returns a Promise that resolves when the design is successfully loaded into the editor.
exportHtml(): Returns a Promise that resolves with the HTML representation of the email template.
exportJson(): Returns a Promise that resolves with the JSON data of the email template.
You can register event handlers for different message types.
editor.registerHandler("UPDATED", (data) => {
console.log("Design updated:", data);
});
Types of events:
"UPDATED": Fired when the email design is updated."LOADED": Fired when the email design is loaded."EXPORT_HTML": Fired when HTML export is requested."EXPORT_JSON": Fired when JSON export is requested.DearJ employs secure message passing between the editor iframe and the parent window. The verifyMessageSecurity function ensures that messages from the iframe are validated using a security token. This prevents unauthorized access and tampering.
DearJ is built with performance in mind, leveraging efficient state updates and ensuring minimal re-renders, especially in React applications. Its lightweight and optimized design ensures smooth user experience even with complex email templates.
DearJ is available under the BSD-3-CLAUSE License.
FAQs
A component for building html content templates using drag and drop.
We found that @dearj/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.