diff --git a/lib/findProjectRoot.js b/lib/findProjectRoot.js
index <HASH>..<HASH> 100644
--- a/lib/findProjectRoot.js
+++ b/lib/findProjectRoot.js
@@ -1,13 +1,15 @@
 import fs from 'fs';
 import path from 'path';
 
+const NODE_MODULES_PATTERN = /\/node_modules$/;
+
 function findRecursive(directory) {
   if (directory === '/') {
     throw new Error('No project root found');
   }
   const pathToPackageJson = path.join(directory, 'package.json');
   const pathToNodeModulesFolder = path.join(directory, 'node_modules');
-  const isPackageDependency = /\/node_modules$/.test(path.dirname(directory));
+  const isPackageDependency = NODE_MODULES_PATTERN.test(path.dirname(directory));
   if (fs.existsSync(pathToPackageJson) &&
     (fs.existsSync(pathToNodeModulesFolder) || isPackageDependency)) {
     return directory;
Move a regex to a constant

This will speed up things a little as the regex can be precompiled. I
don't think this matters much tbh, but it's good practice.