New:Socket for Asana Is Now Available.Learn more
Get Started

@cspell/dynamic-import

Package Overview
Dependencies
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cspell/dynamic-import

Dynamic Module Loader

Source
npmnpm
Version
10.2.0-alpha.2
Version published
Weekly downloads
1.3M
-20.11%
Maintainers
1
Weekly downloads
 
Created
Source

@cspell/dynamic-import

A small library to assist with dynamically loading CommonJS and ESM Modules from either CommonJS or ESM Modules.

Install

npm install -S @cspell/dynamic-import

Usage

Example ESM Package

Example loading chalk v5 which is an ESM only module.

TypeScript Common JS

import { dynamicImport } from '@cspell/dynamic-import';

const pChalk = dynamicImport<typeof import('chalk')>('chalk', __dirname);

TypeScript ESM

import { dynamicImport } from '@cspell/dynamic-import';

const pChalk = dynamicImport<typeof import('chalk')>('chalk', import.meta.url);

Example ESM files

TypeScript Common JS

import { dynamicImport } from '@cspell/dynamic-import';

const pIndex = dynamicImport<typeof import('../esm/index.mjs')>('../esm/index.mjs', __dirname);

Brought to you byStreet Side Software Logo Street Side Software

Keywords

module

FAQs

Package last updated on 28 Aug 2026

Related posts