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.
codemirror-textmate
Advanced tools
Bring TM grammar driven tokenization to your CodeMirror editors.
Say goodbye to the not-so-cool and not-so-accurate syntax highlighting you've been living with and up your game with ease!
This package will only work in browsers with WebAssembly
support. Here's a recommended way to deal with it:
// 95% of your target audience (developers)
if ('WebAssembly' in window) {
const [{
loadWASM
},
{
activateLanguage,
addGrammar
}
] = await Promise.all([
import('onigasm'),
import('codemirror-textmate'),
])
// ... (see https://www.npmjs.com/package/onigasm#light-it-up)
// ... (see example code below)
}
// Fallback for rest 5%
else {
await Promise.all([
import('codemirror/mode/javascript/javascript'),
import( 'codemirror/mode/htmlmixed/htmlmixed'),
])
}
const editor = CodeMirror.fromTextArea( /* ... */ )
// ... (go on as usual)
$ npm i codemirror-textmate
# Install peer dependencies if you haven't already
npm i onigasm codemirror
See ./demo/index.ts
for instructions on how to light it up!
This package is written in TypeScript and is published with TS declaration files. Once you install the package
see node_modules/codemirror-textmate/dist/typings/index.d.ts
for available stuff along with expected data types.
VSCode's intellisense will also pick up the declaration files and guide you nicely with auto-complete and errors.
MIT
FAQs
Textmate based tokenization for CodeMirror
The npm package codemirror-textmate receives a total of 21 weekly downloads. As such, codemirror-textmate popularity was classified as not popular.
We found that codemirror-textmate 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.