Socket
Socket
Sign inDemoInstall

@cspell/dynamic-import

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cspell/dynamic-import - npm Package Compare versions

Comparing version 6.26.0 to 6.26.1

4

package.json

@@ -6,3 +6,3 @@ {

},
"version": "6.26.0",
"version": "6.26.1",
"description": "Dynamic Module Loader",

@@ -60,3 +60,3 @@ "keywords": [

},
"gitHead": "a72f603f4f1afbe237f938b1a23d7cbe2a07d86f"
"gitHead": "675e091816f61ce767c7f9b193ea1384313c8da2"
}

@@ -13,8 +13,32 @@ # `@cspell/dynamic-import`

**TypeScript**
### Example ESM Package
Example loading [chalk v5](https://www.npmjs.com/package/chalk) which is an ESM only module.
**TypeScript Common JS**
```ts
import { dynamicImport } from '@cspell/dynamic-import';
const pChalk = dynamicImport<typeof import('chalk')>('chalk', __dirname);
```
**TypeScript ESM**
```ts
import { dynamicImport } from '@cspell/dynamic-import';
const pChalk = dynamicImport<typeof import('chalk')>('chalk', import.meta.url);
```
### Example ESM files
**TypeScript Common JS**
```ts
import { dynamicImport } from '@cspell/dynamic-import';
const pIndex = dynamicImport<typeof import('../esm/index.mjs')>('../esm/index.mjs', __dirname);
```
<!--- @@inject: ../../static/footer.md --->

@@ -33,1 +57,3 @@

<!--- @@inject-end: ../../static/footer.md --->
<!--- cspell:dictionaries typescript --->
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc