
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
bundlecheck
Advanced tools
Check your application's build size and take code-splitting into account
Check the sizes of your code-splitted bundles. Any file, a lot of predefined rules and fully customized rules can be added.
Since the beginning days, my number one choice was Bundlesize. Not because it is very customizable, but it worked.
While the number of mobile devices is increasing and performance is crucial to a lot of companies, bundles get split in several files.
This lead to more problems with bundlesize, because one can only specify a maxSize
which was not sufficient to me anylonger.
yarn add bundlecheck --dev
npm install bundlecheck --save-dev
All sizes are in KiloByte
Create a basic configuration file with the following content in the root of your project and call it .bundlecheck.config.js
.
module.exports = {
relativeTo: '.',
cwd: '.',
observe: [
{
paths: ['**'],
rules: [{ every: [0.01, 0.5] }],
},
],
}
Inside your package.json
add this to your scripts section:
"scripts": {
"bundlecheck": "bundlecheck"
}
Specify a config file: --configfile
or -cf
cwd
Specifies a root folder from where to find all pathsrelativeTo
Used to make cwd
relative to this specified pathobserve
An array of observable paths on which rules can be appliedrules
: An array of rules that are tested against every entry in observe
ignore
: An array of fast-glob paths that should be ignoredobserve: [
{
paths: ['**.js'] // Use glob patter (fast-glob)
rules: [
every: [0.1, 5], // Any file matched has to be between 100 Bytes and 5 KiloBytes big
sum: [0.001], // The sum of all matching files has to be exactly 1 Byte
mean: [,0.05], // Averaging matched file sizes have to be below 50 Bytes
deviation [1, 2] // Defining the standard deviation of all matched files, so there has to be a difference between all files between 1 and 2 KiloByte
]
}
]
Multiple rules inside of one observe entry are treated with a boolean AND.
observe: [
{
paths: ['**.js']
rules: [
() => ({
result: true,
message: 'This will always result to true',
}),
(sizeMap) => {
const result = sizeMap.reduce((s, [path, size]) => s + size, 0) <= 0.2;
return {
result,
message: result ? 'All Good' :
`Sum of files ${sizeMap.map(([ name ]) => name).join(' ')} too big`,
}
},
]
}
]
Contents of a configuration file used within NextJS
const fs = require('fs');
const buildId = fs.readFileSync('dist/BUILD_ID', 'utf8');
module.exports = {
relativeTo: '.',
cwd: 'dist',
observe: [
{
paths: [`server/static/${buildId}/pages/**.js`],
rules: [{ every: [0, 65] }]
},
{
paths: [`static/css/**.css`],
rules: [{ every: [0, 2.5], sum: [0, 3] }]
},
{
paths: [`static/chunks/!(commons)*.js`],
rules: [{ every: [0, 0.2] }]
},
{
paths: [`static/chunks/commons*.js`],
rules: [{ every: [0, 235] }]
},
{
paths: [`static/${buildId}/pages/!(_app)*.js`],
rules: [{ every: [0, 100], sum: [0, 120] }]
},
{
paths: [`static/${buildId}/pages/_app.js`],
rules: [{ every: [120, 130] }]
},
{
paths: ['static/runtime/main-*.js', 'static/runtime/polyfills-*.js', 'static/runtime/webpack-*.js'],
rules: [{ every: [0, 15], sum: [20, 25] }]
},
],
};
The following features are planned:
FAQs
Check your application's build size and take code-splitting into account
The npm package bundlecheck receives a total of 11 weekly downloads. As such, bundlecheck popularity was classified as not popular.
We found that bundlecheck demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.