Skip to content

Instantly share code, notes, and snippets.

@danmactough
Created April 21, 2015 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danmactough/063d531c89eb5294e9f9 to your computer and use it in GitHub Desktop.
Save danmactough/063d531c89eb5294e9f9 to your computer and use it in GitHub Desktop.
In any koa app, find the app root directory from any location.
var path = require('path');
var appRoot = path.resolve(path.dirname(require.resolve('koa')), '..', '..', '..');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment