You're right. This should work better:
```javascript
var proxy = null
var noproxy = npm.config.get("noproxy") ? 
  npm.config.get("noproxy").replace(/\s/g, "").split(",") : []
if(noproxy.indexOf(remote.hostname) === -1) {
```
Like that, it's possible to have multiple noproxy url in the conf like "foo.bar.com, example.com".