nodebb-plugin-require
v0.0.10
Published
Easily require NodeBB/src modules from within any plugin when running that as a stand-alone script
Downloads
17
Readme
nodebb-plugin-require
Easily require NodeBB/src modules from within any plugin when running that as a stand-alone script
Usage
// from within other plugins
var nodebbRequire = require('nodebb-plugin-require');
// to require the /path/to/NodeBB/src/file
var File = nodebbRequire('/src/file');
// you can also print out the full filepath
console.log(nodebbRequire.fullpath);
// prints /path/to/NodeBB
other functions
You can these 2 for ther other packages as well, not just nodebb
nodebbRequire.isPackageDirectory(name, dir)
nodebbRequire.isPackageDirectory('lodash', '/path/to/somewhere'); // true/false
nodebbRequire.findPackageDirectory(name, startDir)
nodebbRequire.findPackageDirectory('lodash', 'path/to/somwhere/dark/and/scary');