require-mjs-autoprefer-default-export-pmb
v0.1.1
Published
Automatically prefer the `default` export of a `require()`d .mjs file
Downloads
19
Readme
require-mjs-autoprefer-default-export-pmb
Automatically prefer the default
export of a require()
d .mjs file
API
This module exports one function:
autoPreferDefaultExport(imported)
If imported
is an object with only one property, named default
,
returns imported.default
, else returns imported
.
Usage
const autoDefault = require('require-mjs-autoprefer-default-export-pmb');
const libCool = autoDefault(require('./lib/cool'));
Known issues
- Needs more/better tests and docs.
License
ISC