UNPKG

@rx-angular/cdk

Version:

@rx-angular/cdk is a Component Development Kit for ergonomic and highly performant angular applications. It helps to to build Large scale applications, UI libs, state management, rendering systems and much more. Furthermore the unique way of mixing reacti

25 lines (24 loc) 968 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getLatestNodeVersion = getLatestNodeVersion; const http_1 = require("http"); function getLatestNodeVersion(packageName) { const DEFAULT_VERSION = 'latest'; return new Promise((resolve) => { return (0, http_1.get)(`http://registry.npmjs.org/${packageName}`, (res) => { let rawData = ''; res.on('data', (chunk) => (rawData += chunk)); res.on('end', () => { var _a; try { const response = JSON.parse(rawData); const version = (response && response['dist-tags']) || {}; resolve((_a = version.latest) !== null && _a !== void 0 ? _a : DEFAULT_VERSION); } catch (e) { resolve(DEFAULT_VERSION); } }); }).on('error', () => resolve(DEFAULT_VERSION)); }); }