Get information about the package path.
In your module, add the following code:
import { getModulePath } from '@fmtk/package-path';
export const source = getModulePath();
export function foo() {
console.log('hello world');
}
In your dependent module, reference the function like this:
// import the module from above
import * as mymodule from 'mymodule';
// the 'foo' argument is type-checked
const handler = getHandler(mymodule, 'foo');
handler = {
code: '/path/to/node_modules/mymodule/',
handler: 'lib/filename.foo',
};