@platformatic/metaconfig
v1.27.0
Published
Manage mulitple configuration versions at the same time
Downloads
397
Keywords
Readme
@platformatic/metaconfig
Utility module to migrate between one version of Platformatic to another.
Install
npm install @platformatic/metaconfig
Usage
import { analyze, write, upgrade } from '@platformatic/metaconfig'
const meta = await analyze({ file: 'path/to/platformatic.db.json' }))
console.log(meta.version)
console.log(meta.kind)
console.log(meta.config)
console.log(meta.path)
// Bring it to the latest version
const metaNext = upgrade(meta)
console.log(metaNext.version)
console.log(metaNext.kind)
console.log(metaNext.config)
console.log(metaNext.path)
// this will override the old config
await write(metaNext)
License
Apache 2.0