@graphql-codegen/cli
Version:
<p align="center"> <img src="https://github.com/dotansimha/graphql-code-generator/blob/master/logo.png?raw=true" /> </p>
16 lines (15 loc) • 550 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLatestVersion = void 0;
const fetch_1 = require("@whatwg-node/fetch");
/**
* Fetches the version directly from the registry instead of depending on
* an ESM only module as latest-version does.
* @param packageName
*/
async function getLatestVersion(packageName) {
return (0, fetch_1.fetch)(`https://unpkg.com/${packageName}/package.json`)
.then(res => res.json())
.then(pkg => pkg.version);
}
exports.getLatestVersion = getLatestVersion;
;