Gathering detailed insights and metrics for react-textarea-code-editor-2
Gathering detailed insights and metrics for react-textarea-code-editor-2
Gathering detailed insights and metrics for react-textarea-code-editor-2
Gathering detailed insights and metrics for react-textarea-code-editor-2
A simple code editor with syntax highlighting.
npm install react-textarea-code-editor-2
Typescript
Module System
Node Version
NPM Version
TypeScript (80.33%)
Less (11.01%)
HTML (8.49%)
Shell (0.18%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
537 Stars
240 Commits
25 Forks
3 Watchers
8 Branches
11 Contributors
Updated on Jul 09, 2025
Latest Version
1.4.17
Package Id
react-textarea-code-editor-2@1.4.17
Unpacked Size
116.15 kB
Size
23.34 kB
File Count
45
NPM Version
8.11.0
Node Version
16.16.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
3
A simple code editor with syntax highlighting. This library aims to provide a simple code editor with syntax highlighting support without any of the extra features, perfect for simple embeds and forms where users can submit code.
Features:
1$ npm i react-textarea-code-editor-2
1import CodeEditor from 'react-textarea-code-editor-2'; 2 3function App() { 4 const [code, setCode] = React.useState( 5 `function add(a, b) {\n return a + b;\n}` 6 ); 7 return ( 8 <CodeEditor 9 value={code} 10 language="js" 11 placeholder="Please enter JS code." 12 onChange={(evn) => setCode(evn.target.value)} 13 padding={15} 14 style={{ 15 fontSize: 12, 16 backgroundColor: "#f5f5f5", 17 fontFamily: 'ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace', 18 }} 19 /> 20 ); 21}
Use examples in nextjs. #31
1npm install next-remove-imports 2npm install react-textarea-code-editor-2@v1.4.4
1// next.config.js 2const removeImports = require("next-remove-imports")(); 3module.exports = removeImports({ 4 experimental: { esmExternals: true } 5});
1import React from "react"; 2import dynamic from "next/dynamic"; 3import "react-textarea-code-editor-2/dist.css"; 4 5const CodeEditor = dynamic( 6 () => import("react-textarea-code-editor-2").then((mod) => mod.default), 7 { ssr: false } 8); 9 10function HomePage() { 11 const [code, setCode] = React.useState( 12 `function add(a, b) {\n return a + b;\n}` 13 ); 14 return ( 15 <div> 16 <CodeEditor 17 value={code} 18 language="js" 19 placeholder="Please enter JS code." 20 onChange={(evn) => setCode(evn.target.value)} 21 padding={15} 22 style={{ 23 fontSize: 12, 24 backgroundColor: "#f5f5f5", 25 fontFamily: 26 "ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace" 27 }} 28 /> 29 </div> 30 ); 31} 32 33export default HomePage;
See refractor.register(syntax)
to understand
what to pass to syntax
prop.
1interface TextareaCodeEditorProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> { 2 prefixCls?: string; 3 /** 4 * Set what programming language the code belongs to. 5 */ 6 language?: string; 7 /** 8 * Optional padding for code. Default: `10`. 9 */ 10 padding?: number; 11 /** 12 * The minimum height of the editor. Default: `16`. 13 */ 14 minHeight?: number; 15 /** 16 * A refractor syntax (Prism language definition) to be registered by refractor. Default: `undefined`. 17 */ 18 syntax?: refractor.RefractorSyntax; 19}
https://uiwjs.github.io/react-textarea-code-editor/
Runs the project in development mode.
1# Step 1, run first, listen to the component compile and output the .js file 2# listen for compilation output type .d.ts file 3npm run watch 4# Step 2, development mode, listen to compile preview website instance 5npm run start
production
Builds the app for production to the build folder.
1npm run build
The build is minified and the filenames include the hashes. Your app is ready to be deployed!
Licensed under the MIT License.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
Reason
Found 1/26 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More