megahertz / howfat Goto Github PK
View Code? Open in Web Editor NEWShows how fat is a package
License: MIT License
Shows how fat is a package
License: MIT License
this is my package.json
{
"scripts": {
"build": "webpack build"
},
"devDependencies": {
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"antd": "^5.10.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
}
and i got such error
➜ barrel-file-test npx howfat --fields=module
Error: Cannot read properties of undefined (reading 'toString')
➜ barrel-file-test npx howfat -r --fields=module
Error: Cannot read properties of undefined (reading 'toString')
➜ barrel-file-test
it works fine with this command npx howfat antd
When running this tool against packages hosted on private registries and mirrors, it will not work
howfat/src/package/fetchers/NpmFetcher.js
Line 27 in 00269ea
The best way is to inherit the registry from npm configuration or allow to override it through CLI flag. That way, we will gather statistics for private packages as well.
many duplicated dependencies will be hoisted, only one copy should be calculated to the package size
I am getting lots of
# npx howfat
Warning: Timeout error when requesting http://registry.npmjs.org/<package>
Warning: Timeout error when requesting http://registry.npmjs.org/<package>
Warning: Timeout error when requesting http://registry.npmjs.org/<package>
Warning: Timeout error when requesting http://registry.npmjs.org/<package>
Warning: Timeout error when requesting http://registry.npmjs.org/<package>
Error: Timeout error when requesting http://registry.npmjs.org/<package>
When I restart I get to the next package.
Sometimes packages are not on npm registry: local development, monrepos, etc.
It would be nice to get these ignored and not failing, maybe behind a flag: --ignoreMissing
.
Although looking at the code it seems that pulling 404 all the way up to the high level can be non-trivial.
It would be great if howfat supports pnpm workspaces.
"dependencies": {
"@example/core": "workspace:*"
},
Running howfat local inside a monorepo package using "workspace:*"
, currently throws an error.
Error: Unsupported URL Type "workspace:": workspace:*
[email protected] (82 deps, 4.74mb, 888 files)
-> [email protected] (82 deps, 4.74mb, 888 files, deprecated)
... not by name
like analyze-module-size
when i try to run the below command i get the error "listener argument must be a function"
npx howfat jasmine
or
howfat jasmine
please guide me how to resolve this
We are using an internal registry, that requires authentication.
Since howfat does not reuse npmrc configuration for authentication and does not provide parameters for that neither, it is not possible to use it for projects that depends on internal libraries.
Another approach could be to provide a --ignore
parameter where we could set a list of internal packages to ignore.
I think, this tool also help us to extract license information on dependent libraries.Please provide option to extract license information
seems look not support proxy..
It would be nice to have another field that shows the size on disk of a package in node_modules
as there can be quite big differences:
$ howfat picocolors
[email protected] (5.52kb, 7 files, ©ISC)
$ du -sh node_modules/picocolors
28K node_modules/picocolors
https://www.npmjs.com/package/picocolors shows 5.66kB for 'Unpacked Size' - I don't know what data howfat uses.
This is of course only possible if the package is installed locally.
The size on disk could be shown by default when running
howfat .
and ./node_modules
exists, orhowfat x
and ./node_modules/x
exists.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.