Skip to content

Instantly share code, notes, and snippets.

@Loupax
Forked from cramhead/assetPath.js
Last active June 20, 2020 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Loupax/7a758b116dea5d6355bc to your computer and use it in GitHub Desktop.
Save Loupax/7a758b116dea5d6355bc to your computer and use it in GitHub Desktop.
A function that returns the path of the provided package asset
var getAssetPath = function getAssetPath(packageName, assetPath) {
assetPath = assetPath || '';
var meteor_root = Npm.require('fs').realpathSync(process.cwd() + '/../');
var assets_folder = meteor_root + '/server/assets/packages/'+packageName.replace(':','_')+'/'+assetPath;
return assets_folder;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment