Gathering detailed insights and metrics for jsoneditor-react
Gathering detailed insights and metrics for jsoneditor-react
Gathering detailed insights and metrics for jsoneditor-react
Gathering detailed insights and metrics for jsoneditor-react
npm install jsoneditor-react
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
269 Stars
99 Commits
106 Forks
6 Watching
16 Branches
9 Contributors
Updated on 19 Nov 2024
Minified
Minified + Gzipped
JavaScript (99.76%)
CSS (0.24%)
Cumulative downloads
Total Downloads
Last day
-6.4%
4,601
Compared to previous day
Last week
-5.1%
25,087
Compared to previous week
Last month
5.1%
108,997
Compared to previous month
Last year
-7.4%
1,309,013
Compared to previous year
1
2
32
react wrapper implementation for josdejong/jsoneditor
npm install --save jsoneditor jsoneditor-react
jsoneditor-react
using minimalist version of jsoneditor
to minimize flat bundle size, so if you want to use Ajv or Ace Editor install them as well
Version 3.0.0
and higher provide only es build. Also you need some loaders (in terms of webpack) to load json editor icons and css, e.g.:
1module.exports = { 2 module: { 3 rules: [ 4 {test: /\.css$/, loader: 'css-loader'}, 5 {test: /\.svg$/, loader: 'file-loader'} 6 ] 7 } 8};
1import { JsonEditor as Editor } from 'jsoneditor-react'; 2import 'jsoneditor-react/es/editor.min.css';
later in render method:
1render() { 2 return ( 3 <Editor 4 value={yourJson} 5 onChange={this.handleChange} 6 /> 7 ); 8}
If you want use with Ajv:
1import Ajv from 'ajv'; 2 3const ajv = new Ajv({ allErrors: true, verbose: true }); 4 5... 6 7render() { 8 return ( 9 <Editor 10 value={yourJson} 11 onChange={this.handleChange} 12 ajv={ajv} 13 schema={yourSchema} 14 /> 15 ); 16}
If you want use with Ace Editor:
1import ace from 'brace'; 2import 'brace/mode/json'; 3import 'brace/theme/github'; 4 5... 6 7render() { 8 return ( 9 <Editor 10 value={yourJson} 11 onChange={this.handleChange} 12 ace={ace} 13 theme="ace/theme/github" 14 schema={yourSchema} 15 /> 16 ); 17}
Or:
1import 'brace'; 2import 'brace/mode/json'; 3import 'brace/theme/github'; 4 5... 6 7render() { 8 return ( 9 <Editor 10 value={yourJson} 11 onChange={this.handleChange} 12 theme="ace/theme/github" 13 schema={yourSchema} 14 /> 15 ); 16}
Or define your own ace theme
If you using webpack and es6 dynamic imports you can load jsoneditor-react
asynchronously.
You can use react-imported-component or your own implementation
1import importedComponent from 'react-imported-component'; 2 3const JsonEditor = importedComponent(() => import(/* webpackChunkName:'jsoneditor' */'jsoneditor-react'));
Or with Ajv and Ace Editor:
1const JsonEditor = importedComponent(() => Promise.all([ 2 import(/* webpackChunkName:'jsoneditor' */'jsoneditor-react'), 3 import(/* webpackChunkName:'jsoneditor' */'brace'), 4 import(/* webpackChunkName:'jsoneditor' */'ajv'), 5 import(/* webpackChunkName:'jsoneditor' */'brace/mode/json'), 6 import(/* webpackChunkName:'jsoneditor' */'brace/theme/github') 7]).then(([{ JsonEditor: Editor }, ace, Ajv ]) => { 8 const ajv = new Ajv(); 9 return function EditorHoc(props) { 10 return ( 11 <Editor 12 ace={ace} 13 ajv={ajv} 14 theme="ace/theme/github" 15 {...props} 16 /> 17 ); 18 } 19}));
You can view usage of jsoneditor-react
using our storybook.
npm run dev
http://localhost:9001
Right now only one story exporting in storybook: /stories/Editor.jsx
, to add more use /.storybook/config.js
Working on docs
folder.
Right now you can use props declaration
Will be soon!😁
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/4 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
73 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
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