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.
@medimatrix/brace
Advanced tools
browserify compatible version of the ace editor.
This badge shows which browsers support annotations, however the editor itself works in pretty much every browser.
npm install brace
var ace = require('brace');
require('brace/mode/javascript');
require('brace/theme/monokai');
var editor = ace.edit('javascript-editor');
editor.getSession().setMode('ace/mode/javascript');
editor.setTheme('ace/theme/monokai');
Include the above as an entry in your browserify build, add a <div id="javascript-editor"></div>
to your html page and
a JavaScript editor will appear.
This editor will show error/warning annotations if your browser supports WebWorkers created via a blob URL (see testling support badge on top).
Please consult the detailed example for more information.
The ace editor creates the WebWorker via a worker script url. This requires the worker scripts to reside on your server and forces you to host the ace editor on your server as well.
While that is ok in most cases, it prevents you from providing a fully working ace editor package.
With brace, you have two options:
If brace is unable to inline the web worker, it just falls back to provide the ace editor without annotation support. This means the editor is fully functional, but doesn't display errors/warnings on the left side.
As far as I understand, the original ace editor behaves in exactly the same way.
brace has an update script which automatically pulls down the ace builds and refactors them to provide the following:
setMode
and setTheme
use (just replace 'ace' with
'brace') as seen in the above exampleAll workers included with ace are supported, except php
and xquery
, mainly because I wasn't able to properly
stringify their code (any help with that is appreciated).
Yes, brace includes modular type definitions so you can do normal import statements and type safety checking with TypeScript. The example above becomes:
import * as ace from 'brace';
import 'brace/mode/javascript';
import 'brace/theme/monokai';
const editor = ace.edit('javascript-editor');
editor.getSession().setMode('ace/mode/javascript');
editor.setTheme('ace/theme/monokai');
brace exposes these type definitions in package.json
, so they are available when you do npm install brace
.
You do not need an additional install step or another tool to install these definitions.
These type definitions are kept up to date in the same way as the rest of brace. There is an update script which automatically pulls down the DefinitelyTyped definition and refactors it to be modular rather than global.
npm explore brace
npm test
FAQs
Unknown package
The npm package @medimatrix/brace receives a total of 0 weekly downloads. As such, @medimatrix/brace popularity was classified as not popular.
We found that @medimatrix/brace 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.