Skip to content

package: only send relevant files to npm #1

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

Closed
wants to merge 1 commit into from

Conversation

LinusU
Copy link

@LinusU LinusU commented Jun 24, 2015

This will make npm ignore the test/ folder when uploading the package. Saves space and bandwidth for all users 👍

This is especially important on embedded products like the Tessel where every byte counts.

@feross
Copy link
Owner

feross commented Jun 24, 2015

I prefer to ship my module with the documentation and tests included. I often work offline and having documentation (which includes the /test folder) available in node_modules is very helpful. Saving a few KB is a bad tradeoff.

(And I say this as a person with only a 256GB disk in my laptop.)

Related discussions:
nodejs/readable-stream#100
browserify/browserify#1093
browserify/sha.js#5

@feross feross closed this Jun 24, 2015
@LinusU
Copy link
Author

LinusU commented Jun 25, 2015

256GB? Luxury! I have 32MB on my Tessel that I have to contain myself to.

I'm not sure that I personally see the need but if you say you use it, I believe you. Maybe npm should have a requiredFiles field which can be used to remove file after the package has been saved...

@feross
Copy link
Owner

feross commented Jun 25, 2015

I think you'll have a hard time getting everyone to remove these files from their modules, especially if you have a deep dependency tree. That's a lot of PRs!

Maybe you can running a command like rm -rf node_modules/**/test node_modules/**/*.md after install? You can probably craft a command that catches most of the worst file size offenders.

@LinusU
Copy link
Author

LinusU commented Jun 25, 2015

Yeah probably :)

I wish there was some sort of standard for how to publish packages to npm. Kind of like your excellent standard package. Either everyone should use the files or none should.

I've been pondering the idea of actually minifying my code before putting it on npm as well. I think that I see it more like "binary distribution" instead of source distribution, especially since it (should) have link back to the repository with the source.

It would be super cool if npm contained something like WebAssembly packages! But I think that we're a long way from that. Well, a man can dream 🌃 🌠

Thank you for taking time with this issue 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants