Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
codecrush-core
Advanced tools
An javascript/typescript editor for web
Choose your favorite package manager
pnpm install codecrush-core
npm install codecrush-core
yarn add codecrush-core
import { initEditor } from "codecrush-core";
import "codecrush-core/dist/index.css"; // styles from the core package
const app = document.getElementById("app");
if (app) {
initEditor({
height: 400,
id: "js-editor",
parent: app,
theme: "material-darker",
}).then(() => {
console.log("editor loaded");
});
}
List of all themes included
export type EditorThemes =
| "dracula-soft"
| "material-darker"
| "material-default"
| "material-ocean"
| "material-palenight"
| "nord"
| "one-dark-pro"
| "poimandres"
| "rose-pine-moon"
| "rose-pine"
| "slack-dark";
You can create custom components for the editor. The following example we create a component to register in the activity bar which key is pressed.
In this case we'll be using onReady
and onKeyPressed
events provided by the editor.
import { initEditor, Component, ActivityBarComponent } from "codecrush-core";
import "codecrush-core/dist/index.css"; // styles from the core package
class Example extends Component {
onReady() {
const activityBar =
this.editor.getComponent<ActivityBarComponent>("activity-bar"); // get the activity bar
activityBar.registerActivity("key-pressed", "Keyboard: ", false); // register a new entry with id and text
}
onKeyPressed(key: string) {
const activityBar =
this.editor.getComponent<ActivityBarComponent>("activity-bar");
activityBar.updateActivity("key-pressed", "Keyboard: " + key); //update the activity when the key is pressed
}
}
const app = document.getElementById("app");
if (app) {
initEditor({
height: 400,
id: "js-editor",
parent: app,
theme: "material-darker",
components: [Example],
}).then(() => {
console.log("editor loaded");
});
}
FAQs
An javascript/typescript editor for web
The npm package codecrush-core receives a total of 1 weekly downloads. As such, codecrush-core popularity was classified as not popular.
We found that codecrush-core demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.