https://github.com/narazaka/withschemaeditor
JSON/YAML Editor with schemas
https://github.com/narazaka/withschemaeditor
json-schema json-schema-form
Last synced: 4 months ago
JSON representation
JSON/YAML Editor with schemas
- Host: GitHub
- URL: https://github.com/narazaka/withschemaeditor
- Owner: Narazaka
- Created: 2015-10-31T22:59:26.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-11-17T10:51:47.000Z (7 months ago)
- Last Synced: 2025-12-13T20:52:13.610Z (6 months ago)
- Topics: json-schema, json-schema-form
- Language: CoffeeScript
- Size: 43 KB
- Stars: 9
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
WithSchemaEditor
===================
JSON/YAML or any structured data Editor with schemas - using [JSON Editor](https://github.com/jdorn/json-editor)

[](https://app.fossa.io/projects/git%2Bgithub.com%2FNarazaka%2FWithSchemaEditor?ref=badge_shield)
[Schema Plugin](https://www.npmjs.com/search?q=with-schema-editor-schema)
-------------------
WithSchemaEditor requires "schema plugins", node modules whose package name starts with `with-schema-editor-schema-`.
Since node modules' minimal form only requires `index.js`, minimal schema plugin is like below.
- node_modules/with-schema-editor-schema-foo/index.js
```javascript
var fs = require('fs');
module.exports = {
name: 'foo plugin', // schema plugin name
read_type: 'file', // file / directory / both
filters: function(app) { // file dialog filters (electron)
return [
{
name: 'JSON',
extensions: ['json']
}, {
name: 'All files',
extensions: ['*']
}
];
},
load: function(app) { // load target(file or directory) function
var data = JSON.parse(fs.readFileSync(app.target()));
app.editor().setValue(data);
},
save: function(app) { // save function
var data = JSON.stringify(app.editor().getValue());
fs.writeFileSync(app.target(), data);
},
schema: function(app) { // JSON schema (JSON Editor)
return {
title: 'config',
type: 'object',
format: 'grid',
properties: {
target: {
title: 'Target',
type: 'string'
},
schema: {
title: 'Schema Name',
type: 'string'
}
}
};
}
};
```
License
-------------------
This is released under [MIT License](http://narazaka.net/license/MIT?2015).
## License
[](https://app.fossa.io/projects/git%2Bgithub.com%2FNarazaka%2FWithSchemaEditor?ref=badge_large)