I assume your module structure looks like this

/bin/myBin.js
/lib/myUtil.js
index.js
package.json


/// index.js
exports.util = require('./lib/myUtil')
exports.projectDir = __dirname


/// bin/myBin.js
var dir = require('../').projectDir


Does that do what you want?

On Saturday, 3 August 2013 21:24:20 UTC+2, Mark Hahn wrote:
>
> I'm using an npm bin config to create a symlink to a script in my project 
> folder.  When that bin script runs, it has a working directory of the dir 
> the symlink is in, not the project folder.  How do I find the project 
> folder location inside that bin script? 

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to