The code below demonstrates a solution that is immune to the Data loss on OS X Broccoli issue and demonstrated in this gist
Save the following code to linktest.js
:
var fs = require('fs');
// setup structure
fs.mkdirSync(process.cwd() + '/vendor');
fs.mkdirSync(process.cwd() + '/vendor/my_lib');
fs.writeFileSync(process.cwd() + '/vendor/my_lib/foo.js', '// better than nothing');