Is it possible to add additional (data) files to an npm package?


The installation instructions for GeoIP-lite involves copying data files to a directory in the npm package. Either manually or with the command npm run-script updatedb (I’m thinking something could be hacked with the package.json.scripts.start property, but the frequent rebuilds might keep blowing the data away…)

The package works without the data, but it only seems to provide country-level granularity. I suppose the relatively large storage/RAM requirements makes it infeasible anyway, but it might be a (commercial) feature to think about for the future.

Also, this question reminded me: I would love to be able to enter npm install geoip-lite from HyperDev instead of having to modify the package.json.

It was annoying to constantly look up packages’ latest version numbers, but I guess I could just use version "*"


Not really - we’re not setup to handle moving large volumes of data between install and runtime, so it would take some work to support. And as you mention, it’d also be memory intensive. But it’s definitely something we’ll keep in mind as we continue to develop the system whilst in beta.

Yeah, embedded npm just uses * too. I’ll pass that suggestion on.