isaacs/npm — pull request #2254 by regality (2012-03-11 09:42:15+00:00)
Title: #472: Adds support for os and cpu fields in package.json

This patch adds support for os and cpu fields in pacakge.json. It allows whitelisting or blacklisting operating systems and cpu architectures.

There was some discussion about using semver or minimatch on os versions, but it seems like the os version would rarely be a factor, and much more likely compiler and library versions, which would be handled by a makefile; so I elected to only handle platform types, such as `win32` or `darwin`.

I added some documentation to doc/cli/json.md to explain how to use the options.