@nutsloop/ivy-async-import-meta-resolve
Version:
async import.meta.resolve wrapper for node v20. ESModule.
58 lines (34 loc) • 796 B
Markdown
___
___
___
- [Description](
- [Installation](
- [Usage](
___
___
From Node.js v20 import.meta.resolve function is no longer a Promise.
this reinstates the fantastic async function.
___
___
```shell
npm install @nutsloop/ivy-async-import-meta-resolve
```
___
___
```js
import { async_import_meta_resolve } from '@nutsloop/ivy-async-import-meta-resolve';
const path = await async_import_meta_resolve('typescript')
.catch( error => error );
if( path instanceof Error ){
process.stderr.write( path.message );
process.exit( 1 );
};
process.stdout.write( path );
```
___