Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 629 Bytes

README.md

File metadata and controls

34 lines (24 loc) · 629 Bytes

@fmtk/package-path

Get information about the package path.

Quick start

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',
};