Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@verdaccio/web
Advanced tools
import buildDebug from 'debug'; import sanitizyReadme from '@verdaccio/readme';
import { allow, $RequestExtend, $ResponseExtend, $NextFunctionVer } from '@verdaccio/middleware'; import { HEADER_TYPE, HEADERS } from '@verdaccio/commons-api'; import { Router } from 'express'; import { IAuth } from '@verdaccio/auth'; import { Storage } from '@verdaccio/store'; import { Package } from '@verdaccio/types';
import { addScope, AuthorAvatar, parseReadme } from '../utils/web-utils';
export { $RequestExtend, $ResponseExtend, $NextFunctionVer }; // Was required by other packages
export type PackageExt = Package & { author: AuthorAvatar; dist?: { tarball: string } };
const debug = buildDebug('verdaccio:web:api:readme');
export const NOT_README_FOUND = 'ERROR: No README data found!';
function addReadmeWebApi(route: Router, storage: Storage, auth: IAuth): void { debug('initialized readme web api'); const can = allow(auth);
route.get( '/package/readme/(@:scope/)?:package/:version?', can('access'), function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void { debug('readme hit'); const packageName = req.params.scope ? addScope(req.params.scope, req.params.package) : req.params.package; debug('readme name %o', packageName);
// @ts-ignore
storage.getPackage({
name: packageName,
uplinksLook: true,
req,
callback: function (err, info): void {
debug('readme plg %o', info?.name);
if (err) {
return next(err);
}
res.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.TEXT_PLAIN_UTF8);
try {
next(parseReadme(info.name, info.readme));
} catch {
next(sanitizyReadme(NOT_README_FOUND));
}
},
});
}
); }
export default addReadmeWebApi;
FAQs
web ui middleware
The npm package @verdaccio/web receives a total of 3,532 weekly downloads. As such, @verdaccio/web popularity was classified as popular.
We found that @verdaccio/web demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.