Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

2d-brace

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

2d-brace

browserify compatible version of the ace editor.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
0
Created
Source

brace

[原始仓库]https://github.com/thlorenz/brace.git

[业务改造仓库]https://github.com/kkYFL/2d-brace.git

Installation

npm install brace

Example

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.

Can I use it with TypeScript?

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');

Test

npm explore brace
npm test

分支

2d-branch 业务改造分支

Keywords

ace

FAQs

Package last updated on 30 Dec 2024

Did you know?

Socket

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.

Install

Related posts