Schema Builder For UpdateForge
npm install updateforge-js
import { SchemaBuilder } from 'updateforge-js';
// Create an instance of SchemaBuilder
const builder = new SchemaBuilder();
// Set metadata
builder.setMetadata({
icon: 'icon-path',
name: 'My App',
description: 'A short description of my app',
author: 'John Doe',
source_code: 'https://github.com/example/my-app',
homepage: 'https://example.com',
});
// Add a release
builder.addRelease({
version: '1.0.0',
type: 'major',
properties: { /* properties */ },
downloadUrl: 'https://download-url.com',
});
// Get the latest version
const latestVersion = builder.getLatestVersion();
console.log('Latest version:', latestVersion);
// Get all versions
const allVersions = builder.getAllVersions();
console.log('All versions:', allVersions);
// Convert data to output string
const outputString = builder.toOutput();
console.log('Output:', outputString);
Set metadata for the SchemaBuilder instance.
Add a release to the list of releases.
Convert the SchemaBuilder data to a formatted JSON string.
Get the latest version from the list of releases.
Get an array of all versions from the list of releases.
This project is licensed under the MIT License - see the LICENSE file for details.