Skip to content
This repository was archived by the owner on Apr 14, 2025. It is now read-only.

Repository files navigation

@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

// CommonJSconst{ startJSONEditor }=require('@rhidium/json-editor')const{ readFileSync }=require('fs')// ESMimport{startJSONEditor}from'@rhidium/json-editor'import{readFileSync}from'fs'constjsonSchema=readFileSync('./config.schema.json','utf-8');startJSONEditor({port: 3000,dataFilePath: './config.json',data: {},// Default data, if not read from filecreateBackup: true,schemaString: jsonSchema},{// Some additional editor options// All native @json-editor/json-editor options are available// These are our defaultstheme: '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

About

A simple web-based JSON file editor, written in TypeScript.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages