Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rhidium/json-editor
A simple web-based JSON file editor, written in TypeScript.
https://github.com/rhidium/json-editor
configuration configuration-editor express express-handlebars handlebars json json-editor web-editor
Last synced: 3 days ago
JSON representation
A simple web-based JSON file editor, written in TypeScript.
- Host: GitHub
- URL: https://github.com/rhidium/json-editor
- Owner: rhidium
- Created: 2023-11-10T15:06:59.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-13T13:13:46.000Z (10 months ago)
- Last Synced: 2024-12-04T03:12:18.423Z (2 months ago)
- Topics: configuration, configuration-editor, express, express-handlebars, handlebars, json, json-editor, web-editor
- Language: TypeScript
- Homepage: https://rhidium.xyz
- Size: 112 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![Font_PNG](https://github.com/rhidium/core/assets/57721238/9ccc5763-8336-4d1e-8187-a738bafdc519)
Core
•
Template
•
JSON Editor
•
Placeholder
# @rhidium/json-editor
This is a simple, web-based JSON editor for our Discord bots, but it can be used with any JSON schema. It is only meant to be used locally and is merely intended as a convenient solution for our users that aren't familiar with JSON.
When a JSON is saved locally, a backup will be created of the original file (if is exists) before it is created.
## Using the editor
Install the package: `npm i @rhidium/json-editor`
And start the express app:
`scripts/json-editor.js`
```js
// CommonJS
const { startJSONEditor } = require('@rhidium/json-editor')
const { readFileSync } = require('fs')
// ESM
import { startJSONEditor } from '@rhidium/json-editor'
import { readFileSync } from 'fs'const jsonSchema = readFileSync('./config.schema.json', 'utf-8');
startJSONEditor({
port: 3000,
dataFilePath: './config.json',
data: {}, // Default data, if not read from file
createBackup: true,
schemaString: jsonSchema
}, {
// Some additional editor options
// All native @json-editor/json-editor options are available
// These are our defaults
theme: 'bootstrap5',
iconlib: "fontawesome5",
disable_collapse: false,
disable_edit_json: true,
disable_properties: true,
no_additional_properties: true,
})
```And start the script: `node scripts/json-editor.js`