/esm-ts

Use ESM modules in TypeScript without any configuration

Primary LanguageJavaScriptMIT LicenseMIT

esm-ts

Version

Import ESM modules into your typescript without messing your configuration.

If you are importing an ESM module within a typescript project and receiving the following error then this package might save you some headaches. Don't forget to star ;)

Error [ERR_REQUIRE_ESM]: require() of ES Module

Install

npm install esm-ts

Usage

Install the ESM module you want to use. Then import it using the following function

import { requiresm } from 'ts-esm'
// specify the module you want to import
const ora = await requiresm('ora');
ora.start();

Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2022 Anis Marrouchi.

This project is MIT licensed.


This README was generated with ❤️ by readme-kodyfire