0.1.1 • Published 2 years ago
verify-window-global-library-version-pmb v0.1.1
verify-window-global-library-version-pmb
Utility function to ensure window.Vue is compatible with my web app.
API
This module exports one function:
verifyLibraryVersion(key, wantMajor, minMinor)
Checks window[key].version
.
If acceptable, returns window[key]
.
Throws an error if the major version is not wantMajor
or the minor version is lower than minMinor
.
Usage
const needLibVer = require('verify-window-global-library-version-pmb');
const Vue = needLibVer('Vue', 2, 6);
needLibVer('Vuex', 3, 6);
Known issues
- Needs more/better tests and docs.
License
ISC