@octy/versify-js
v1.0.3
Published
Supports Node.js 18+ and React Native 0.4.+.
Maintainers
Readme
GetByUrlStrategy
GetByUrlStrategy is a strategy class for fetching and validating a version manifest from a remote URL. It works in environments where fetch is available (browsers, React Native, Node.js 18+).
Installation
npm install @octy/versify-jsUsage
Check Version
import { GetByUrlStrategy, Versify } from '@octy/versify-js';
const strategy = new GetByUrlStrategy('<your-url-to-manifest>');
const versify = new Versify(strategy);
versify.check('1.0.0');Get Version Manifest Directly
import { GetByUrlStrategy, Versify } from '@octy/versify-js';
const strategy = new GetByUrlStrategy('<your-url-to-manifest>');
const versify = new Versify(strategy);
versify.getVersionManifest();Manifest Format
The remote JSON must have the following structure:
{
"min": "1.0.0",
"lts": "1.0.1"
}min: Minimum supported version (number)lts: Latest LTS version (number)
Requirements
- Node.js 18+ (or polyfilled fetch)
- React Native (fetch is available globally)
- Web browsers
Note: Additional manifest get strategies will be added soon.
