Package detail

has-dynamic-import

inspect-js777.7kMIT2.1.1

Does the current environment have import() support?

import, dynamic, modules, esm

readme

has-dynamic-import Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Does the current environment have import() support?

At the time of this writing, node v12.17+, v13.2+ and v14.0+ has support for dynamic import(); the syntax is supported in node v10+.

The former can be checked in the package‘s main export, which is an async function that returns a boolean indicating if the current environment fully supports dynamic import. Note that in node v12.17 - v12.19 and v13.4 - v13.13, an ExperimentalWarning will be logged.

The latter can be checked with 'has-dynamic-import/syntax', which is a function that returns a boolean indicating if the current environment supports parsing the syntax of dynamic import.

Tests

Simply clone the repo, npm install, and run npm test

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v2.1.1 - 2024-12-15

Commits

  • [types] use shared config 72a0c9f
  • [actions] split out node 10-20, and 20+ 080e3da
  • [Dev Deps] update @ljharb/eslint-config, @ljharb/tsconfig, @types/node, @types/tape, auto-changelog, tape f110c4a
  • [Refactor] use call-bound directly bb5bbfe
  • [Dev Deps] update @types/node, @types/semver, tape, typescript e9e8116
  • [Deps] update call-bind, get-intrinsic fc96301
  • [Deps] update call-bind, get-intrinsic 2a24231
  • [Tests] fix a spurious failure caused by a deprecation warning 3458310
  • [Tests] replace aud with npm audit d6b1f10
  • [Dev Deps] add missing peer dep c8dbae1

v2.1.0 - 2024-01-12

Commits

  • [meta] use npmignore to autogenerate an npmignore file 16fda28
  • [New] add inline jsdoc types, for TS 4d07733
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, tape 63fe5e3
  • [actions] update rebase action to use reusable workflow 5bc0894
  • [Dev Deps] update @ljharb/eslint-config, aud, npmignore, semver, tape 201283d
  • [Deps] update call-bind, get-intrinsic 4a5bed0
  • [meta] add missing engines.node b544707
  • [Robustness] make promiselikes into null objects ffded66
  • [Deps] update get-intrinsic dc65726
  • [meta] add sideEffects flag 512e0fd

v2.0.1 - 2021-12-12

Commits

  • [actions] reuse common workflows 308d8fb
  • [Fix] ensure the fake promise resolves on nextTick dea0dbc
  • [Dev Deps] update eslint, @ljharb/eslint-config, safe-publish-latest, tape 5e9431c
  • [actions] update codecov uploader 0b8d3f8
  • [Dev Deps] update eslint, @ljharb/eslint-config, safe-publish-latest, tape 8fcdc05

v2.0.0 - 2021-05-30

Commits

  • [Breaking] main entry point exports an async function and checks functionality; "syntax" entry point exports previous predicate dedeaac

v1.1.0 - 2021-05-30

Commits

  • [New] add syntax entry point that matches current main entry point 6a1ac52
  • [Dev Deps] update eslint, auto-changelog c8c737f

v1.0.1 - 2021-05-13

Commits

v1.0.0 - 2021-05-13

Commits