GitHub, which owns the npm registry for JavaScript packages, says it is tightening security in response to recent attacks.