Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@directus/update-check

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@directus/update-check - npm Package Compare versions

Comparing version 11.0.2 to 11.0.3

dist/cache.d.ts

28

dist/index.js
import boxen, {} from 'boxen';
import chalk from 'chalk';
import findCacheDirectory from 'find-cache-dir';
import { fetchBuilder, FileSystemCache } from 'node-fetch-cache';
import got from 'got';
import { gte, prerelease } from 'semver';
const cacheDirectory = findCacheDirectory({ name: 'directus' });
const fetch = fetchBuilder.withCache(new FileSystemCache({ ttl: 60 * 60, ...(cacheDirectory && { cacheDirectory }) }));
import { getCache } from './cache.js';
const cache = await getCache();
export async function updateCheck(currentVersion) {
let packageManifest = undefined;
let packageManifest;
try {
const response = await fetch('https://registry.npmjs.org/directus', {
packageManifest = await got('https://registry.npmjs.org/directus', {
headers: { accept: 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' },
});
if (!response.ok) {
response.ejectFromCache();
return;
}
packageManifest = await response.json();
cache,
retry: {
limit: 0,
},
timeout: {
request: 8000,
},
}).json();
}
catch (error) {
// Ignore
// Any errors are intentionally ignored & update message simply not printed
return;
}

@@ -23,0 +25,0 @@ if (!packageManifest) {

{
"name": "@directus/update-check",
"version": "11.0.2",
"description": "Check if an update is available for a given package",
"version": "11.0.3",
"description": "Check if an update for Directus is available",
"homepage": "https://directus.io",

@@ -24,14 +24,18 @@ "repository": {

"dependencies": {
"boxen": "7.1.0",
"chalk": "5.2.0",
"find-cache-dir": "4.0.0",
"node-fetch-cache": "3.1.3",
"semver": "7.5.1"
"boxen": "7.1.1",
"chalk": "5.3.0",
"filenamify": "6.0.0",
"find-cache-dir": "5.0.0",
"got": "13.0.0",
"semver": "7.5.4"
},
"devDependencies": {
"@npm/types": "1.0.2",
"@types/find-cache-dir": "3.2.1",
"@types/node-fetch-cache": "3.0.0",
"@types/semver": "7.5.0",
"@types/node": "18.16.12",
"@types/semver": "7.5.1",
"@vitest/coverage-c8": "0.31.1",
"keyv": "4.5.2",
"strip-ansi": "7.1.0",
"typescript": "5.0.4",
"vitest": "0.31.1",
"@directus/tsconfig": "1.0.0"

@@ -41,4 +45,5 @@ },

"build": "tsc --project tsconfig.prod.json",
"dev": "tsc --watch"
"dev": "tsc --watch",
"test": "vitest --watch=false"
}
}
# `@directus/update-check`
Check if an update is available for a given package
Check if an update for Directus is available
## Description
This package is a utility to determine if there is an update available for a given package.
This package is a utility to determine if there is an update available for Directus.

@@ -9,0 +9,0 @@ For more information about Directus, visit the [official website](https://directus.io).

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc