To use as a dependency, add the following to your package.json
:
"mapnik-test-data":"https://mapbox-npm.s3.amazonaws.com/package/mapnik-test-data-2.1.1-d1476b261f018c28f08c573de3c9885386f52315.tgz"
Then use in your js file like so:
//require
var pathToData = path.dirname(require.resolve('mapnik-test-data'));
//and use
fs.readFile(pathToData + '/data/geotiff/sample.tif', function (err, data) {
if (err) throw err;
console.log(data);
});