@lateos/npm-scan 0.12.1 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/fetch.js +4 -3
- package/package.json +1 -1
package/backend/fetch.js
CHANGED
|
@@ -8,8 +8,9 @@ import { pipeline } from 'stream/promises';
|
|
|
8
8
|
|
|
9
9
|
export async function fetchPackage(target, options = {}) {
|
|
10
10
|
const { cacheDir, cacheTTL = 604800, cacheMaxSize = 1000000000 } = options;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const [name, version] = target.split('@').slice(1);
|
|
12
|
+
const endpoint = version ? `/${name}/v/${version}` : `/${target}/latest`;
|
|
13
|
+
|
|
13
14
|
if (cacheDir) {
|
|
14
15
|
const cached = getFromCache(cacheDir, target, cacheTTL);
|
|
15
16
|
if (cached) {
|
|
@@ -18,7 +19,7 @@ export async function fetchPackage(target, options = {}) {
|
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
const metaRes = await fetch(`https://registry.npmjs.org
|
|
22
|
+
const metaRes = await fetch(`https://registry.npmjs.org${endpoint}`);
|
|
22
23
|
const meta = await metaRes.json();
|
|
23
24
|
|
|
24
25
|
if (!metaRes.ok || !meta.dist?.tarball) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lateos/npm-scan",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "Modern npm supply chain security scanner — detects obfuscated payloads, credential stealers, conditional triggers, sandbox evasion, and worm-like propagation. 11 attack types, SBOM, NIST/EU CRA compliance reporting.",
|
|
5
5
|
"main": "backend/index.js",
|
|
6
6
|
"bin": {
|