Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Brotli encoder and decoder for hapi.js.
Lead Maintainer - Gil Pedersen
npm install brok
Registration with custom quality default:
'use strict';
const Hapi = require('@hapi/hapi');
const Brok = require('brok');
const server = new Hapi.Server({ port: 3000, compression: { minBytes: 1 } });
const provision = async () => {
server.route({
method: 'GET',
path: '/fetch',
handler() {
return 'ok';
}
});
await server.register({
plugin: Brok,
options: {
compress: { quality: 3 }
}
});
await server.start();
console.log('Server running at:', server.info.uri);
};
provision();
Once registered, brok enables the server to negotiate and handle the "br"
encoding for
compressible responses and uploads.
brok accepts the following registration options:
compress
- compression settings.
Set to false
to disable response compression using brotli.
quality
- used to adjust compression speed vs quality from 0 to 11.
Defaults to 5
.mode
- compression mode.
Available values:
'generic'
- default compression mode. Default value.'text'
- optimize for UTF-8 formatted text input.decompress
- if true
, also register the encoding for decompressing incoming payloads.
Defaults to false
.Route specific settings can be set using br
object in the compression
config. Eg.
server.route({
method: 'GET',
path: '/text',
options: {
handler() {
return 'hello!';
},
compression: {
br: { mode: 'text' }
}
}
});
FAQs
Brotli encoder and decoder for hapi.js
The npm package brok receives a total of 6,129 weekly downloads. As such, brok popularity was classified as popular.
We found that brok demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.