-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only output total size? #51
Comments
It seems your need is fulfilled by https://github.com/siddharthkp/bundlesize. Have you checked it out? |
@alshakero sadly not, it doesn't include the node modules. |
@Siilwyn Hey! This is not something You might like dirsize or get-folder-size You would already install #!/usr/bin/env node
const getSize = require('get-folder-size') // gives size in bytes
const bytes = require('bytes')
const limit = process.argv[2] // accept size as a parameter
const limitInBytes = bytes(limit, { unit: 'B' })
getSize('node_modules', (err, size) => {
if (size > limitInBytes) {
console.error('whoa whoa whoa hold it right here')
process.exit(1)
}
}) You can use the above with |
👋 would you accept at PR that adds a flag to only output the total size? I want to run this module from in a CI task and fail if the total size goes about a certain number. Couldn't find any module that does this out of the box.
The text was updated successfully, but these errors were encountered: