package-main

require your main module

Usage no npm install needed!

<script type="module">
  import packageMain from 'https://cdn.skypack.dev/package-main';
</script>

README

package-main Build Status

require your "main" module

Install

$ npm install --save package-main

Usage

require('package-main')(__dirname)
//=> the main parent

API

packageMain([cwd]) -> Any

cwd

Required
Type: string

The current working directory from which to traverse upwards for the main script

License

MIT © Ben Drucker