0.1.2 • Published 5 years ago

@fmtk/package-path v0.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

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