Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
@astii/code-editor
Advanced tools
a JS code editor based on codeMirror, support code autoCompletion, which can be used with @astii/expression-sandbox
npm install @astii/code-editor --save
or
yarn add @astii/code-editor
import React, { useState, useRef } from 'react'
import ReactDOM from 'react-dom/client'
import { CodeEditor, CodeEditorConfig } from '@astii/code-editor'
import styles from "./index.less"
const App = () => {
const [value, setValue] = useState<string>('')
const editorRef = useRef()
const [completions, setCompletions] = useState([
{
label: "inputValue",
detail: "izssf",
docs: "sfsdfsf",
properties: [
{
label: "a",
detail: "asfs"
}
]
},
{
label: "@unction",
docs: "sfjhbsf12424323是否会被生机勃发",
}
])
const onChange = (value) => {
setValue(value)
}
const onClick = () => {
const text = "sfsfsfs";
editorRef.current.insertDoc(text); //insert doc to position of cursor
editorRef.current.getDoc(); //get doc
};
return (
<div>
<CodeEditor
ref={editorRef}
className={styles.wrap}
value={value}
completions={completions}
onChange={onChange}
/>
<button type="button" onClick={onClick}>
insert
</button>
</div>
);
}
const root = ReactDOM.createRoot(document.getElementById('root') as Element)
root.render(<App />)
FAQs
Unknown package
The npm package @astii/code-editor receives a total of 6 weekly downloads. As such, @astii/code-editor popularity was classified as not popular.
We found that @astii/code-editor demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.