Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

More robust check for running under node

Check if module.exports exists, since this is a more reliable check if
we are running under node. Checking for window conflicts with some
node modules like d3 that define a global window object.
  • Loading branch information...
commit b4fb6319167966cd77e0074f1beea5f966ee46a1 1 parent 4205239
Greg Methvin authored November 15, 2012

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  lib/crc.js
2  lib/crc.js
@@ -399,7 +399,7 @@
399 399
 
400 400
 	var target, property;
401 401
 
402  
-	if(typeof(window) == 'undefined')
  402
+	if(typeof(module) !== 'undefined' && module.exports)
403 403
 	{
404 404
 		target = module;
405 405
 		property = 'exports';

0 notes on commit b4fb631

Please sign in to comment.
Something went wrong with that request. Please try again.