
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
check-pkg-new-version-engine
Advanced tools
Provide generic engine for npm CLI packages to check newer version
Provide generic engine for npm CLI packages to check newer version.
Example:
import os from "os";
import Path from "path";
import { promises as Fs } from "fs";
import fetch from "node-fetch"; // or your favorite fetch lib
import ini from "ini";
import semver from "semver";
import { checkPkgNewVersionEngine } from "check-pkg-new-version-engine";
const myPkg = require("./package.json");
async function loadIni(dir, rcFile = ".npmrc") {
try {
const iniFile = Path.join(dir, rcFile);
const iniData = await Fs.readFile(iniFile, "utf-8");
const iniRc = ini.parse(iniData);
return iniRc;
} catch {
return {};
}
}
async function getNpmRcConfig() {
return { ...(await loadIni(os.homedir())), ...(await loadIni(process.cwd())) };
}
async function start() {
checkPkgNewVersionEngine({
pkg,
// without npm config the engine falls back to "https://registry.npmjs.org/"
npmConfig: await getNpmRcConfig(),
checkIsNewer: (pkg, distTags, tag) => semver.gt(distTags[tag], pkg.version),
fetchJSON: async (url, options) => {
const res = await fetch(url, options);
return await res.json();
},
});
}
FAQs
Provide generic engine for npm CLI packages to check newer version
The npm package check-pkg-new-version-engine receives a total of 3 weekly downloads. As such, check-pkg-new-version-engine popularity was classified as not popular.
We found that check-pkg-new-version-engine demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.