Reputation: 25
I download nodejs package by commit: npm install -g package_name But I find some package downloaded has diffrent files with ther same package on Github.Why?
Upvotes: 0
Views: 54
Reputation: 2323
A developer creates a package when he thinks the code is stable, and continues developing on future updates.
So github code is Work in Progress code for the next update, npm package is the latest stable version of the package.
In above case, if you want to see the npm package code in github look for the tag with the package version.
Also files in npm package can be compiled code while github contains the source code. Using .gitignore
a developer can exclude compiled files from github repo and using .npmignore
a developer can exclude source files from npm package (not often the case, but can be done)
So the reason for difference in code can be one of these.
Upvotes: 2