{"_id":"has-dynamic-import","_rev":"305034","name":"has-dynamic-import","description":"Does the current environment have `import()` support?","dist-tags":{"latest":"2.1.0"},"maintainers":[{"name":"ljharb","email":""}],"time":{"modified":"2024-02-17T15:43:28.000Z","created":"2021-05-14T03:42:31.398Z","2.1.0":"2024-01-13T06:40:24.439Z","2.0.1":"2021-12-13T01:52:48.786Z","2.0.0":"2021-05-31T06:08:55.535Z","1.1.0":"2021-05-31T06:07:48.783Z","1.0.1":"2021-05-14T04:00:53.023Z","1.0.0":"2021-05-14T03:42:31.398Z"},"users":{},"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/inspect-js/has-dynamic-import.git"},"versions":{"2.1.0":{"name":"has-dynamic-import","version":"2.1.0","description":"Does the current environment have `import()` support?","main":"index.js","browser":{"./":"./browser.js","./syntax":"./browser-syntax.js"},"exports":{".":[{"browser":"./browser.js","default":"./index.js"},"./index.js"],"./syntax":[{"browser":"./browser-syntax.js","default":"./syntax.js"},"./syntax.js"],"./package.json":"./package.json"},"sideEffects":false,"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated && npm run emit-types","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=.js,.mjs .","tsc":"tsc -p .","postlint":"npm run tsc","preemit-types":"rm -f *.ts *.ts.map test/*.ts test/*.ts.map","emit-types":"npm run tsc -- --noEmit false --emitDeclarationOnly","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/inspect-js/has-dynamic-import.git"},"keywords":["import","dynamic","modules","esm","javascript","ecmascript","esmodules"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/inspect-js/has-dynamic-import/issues"},"homepage":"https://github.com/inspect-js/has-dynamic-import#readme","devDependencies":{"@ljharb/eslint-config":"^21.1.0","@types/call-bind":"^1.0.5","@types/node":"^20.11.0","@types/semver":"^7.5.6","@types/tape":"^5.6.4","aud":"^2.0.4","auto-changelog":"^2.4.0","eslint":"=8.8.0","in-publish":"^2.0.1","npmignore":"^0.3.1","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","semver":"^6.3.1","tape":"^5.7.2","typescript":"^5.4.0-dev.20240112"},"directories":{"test":"test"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"dependencies":{"call-bind":"^1.0.5","get-intrinsic":"^1.2.2"},"testling":{"files":"test/index.js"},"publishConfig":{"ignore":[".github/workflows","!*.d.ts","!*.d.ts.map"]},"engines":{"node":">= 0.4"},"_id":"has-dynamic-import@2.1.0","gitHead":"624718aab0278af082c3c55f4ad767935bda4f1f","types":"./index.d.ts","_nodeVersion":"21.5.0","_npmVersion":"10.2.4","dist":{"shasum":"06359ad7672b9e764aea93a54bb9d6e17542d34c","size":8411,"noattachment":false,"key":"/has-dynamic-import/-/has-dynamic-import-2.1.0.tgz","tarball":"http://name.csiicloud.com:7001/has-dynamic-import/download/has-dynamic-import-2.1.0.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/has-dynamic-import_2.1.0_1705128024280_0.46263960774115165"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-01-13T06:40:24.439Z","publish_time":1705128024439,"_source_registry_name":"default","_cnpm_publish_time":1705128024439},"2.0.1":{"name":"has-dynamic-import","version":"2.0.1","description":"Does the current environment have `import()` support?","main":"index.js","browser":{"./":"./browser.js","./syntax":"./browser-syntax.js"},"exports":{".":[{"browser":"./browser.js","default":"./index.js"},"./index.js"],"./syntax":[{"browser":"./browser-syntax.js","default":"./syntax.js"},"./syntax.js"],"./package.json":"./package.json"},"scripts":{"prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=.js,.mjs .","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/inspect-js/has-dynamic-import.git"},"keywords":["import","dynamic","modules","esm","javascript","ecmascript","esmodules"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/inspect-js/has-dynamic-import/issues"},"homepage":"https://github.com/inspect-js/has-dynamic-import#readme","devDependencies":{"@ljharb/eslint-config":"^20.0.0","aud":"^1.1.5","auto-changelog":"^2.3.0","eslint":"^8.4.1","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","semver":"^6.3.0","tape":"^5.3.2"},"directories":{"test":"test"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"dependencies":{"call-bind":"^1.0.2","get-intrinsic":"^1.1.1"},"testling":{"files":"test/index.js"},"gitHead":"868690725a0ab6b5d25c5f94849ddc5f5204661b","_id":"has-dynamic-import@2.0.1","_nodeVersion":"17.2.0","_npmVersion":"8.1.4","dist":{"shasum":"9bca87846aa264f2ad224fcd014946f5e5182f52","size":5741,"noattachment":false,"key":"/has-dynamic-import/-/has-dynamic-import-2.0.1.tgz","tarball":"http://name.csiicloud.com:7001/has-dynamic-import/download/has-dynamic-import-2.0.1.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/has-dynamic-import_2.0.1_1639360368424_0.33094253980570887"},"_hasShrinkwrap":false,"publish_time":1639360368786,"_cnpm_publish_time":1639360368786,"_cnpmcore_publish_time":"2021-12-13T08:25:57.290Z"},"2.0.0":{"name":"has-dynamic-import","version":"2.0.0","description":"Does the current environment have `import()` support?","main":"index.js","browser":{"./":"./browser.js","./syntax":"./browser-syntax.js"},"exports":{".":[{"browser":"./browser.js","default":"./index.js"},"./index.js"],"./syntax":[{"browser":"./browser-syntax.js","default":"./syntax.js"},"./syntax.js"],"./package.json":"./package.json"},"scripts":{"prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=.js,.mjs .","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/inspect-js/has-dynamic-import.git"},"keywords":["import","dynamic","modules","esm","javascript","ecmascript","esmodules"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/inspect-js/has-dynamic-import/issues"},"homepage":"https://github.com/inspect-js/has-dynamic-import#readme","devDependencies":{"@ljharb/eslint-config":"^17.6.0","aud":"^1.1.5","auto-changelog":"^2.3.0","eslint":"^7.27.0","nyc":"^10.3.2","safe-publish-latest":"^1.1.4","semver":"^6.3.0","tape":"^5.2.2"},"directories":{"test":"test"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"dependencies":{"call-bind":"^1.0.2"},"testling":{"files":"test/index.js"},"gitHead":"9f2d32634359b2e0c722372d67af726e50b46c55","_id":"has-dynamic-import@2.0.0","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"shasum":"d96d140ff7cbde2fee58c00e2123d7078bfc365e","size":5332,"noattachment":false,"key":"/has-dynamic-import/-/has-dynamic-import-2.0.0.tgz","tarball":"http://name.csiicloud.com:7001/has-dynamic-import/download/has-dynamic-import-2.0.0.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/has-dynamic-import_2.0.0_1622441335407_0.6359442570062595"},"_hasShrinkwrap":false,"publish_time":1622441335535,"_cnpm_publish_time":1622441335535,"_cnpmcore_publish_time":"2021-12-13T08:25:57.612Z"},"1.1.0":{"name":"has-dynamic-import","version":"1.1.0","description":"Does the current environment have `import()` support?","main":"index.js","browser":{"./":"./browser.js","./syntax":"./browser-syntax.js"},"exports":{".":[{"browser":"./browser.js","default":"./index.js"},"./index.js"],"./syntax":[{"browser":"./browser-syntax.js","default":"./syntax.js"},"./syntax.js"],"./package.json":"./package.json"},"scripts":{"prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=.js,.mjs .","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/inspect-js/has-dynamic-import.git"},"keywords":["import","dynamic","modules","esm","javascript","ecmascript","esmodules"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/inspect-js/has-dynamic-import/issues"},"homepage":"https://github.com/inspect-js/has-dynamic-import#readme","devDependencies":{"@ljharb/eslint-config":"^17.6.0","aud":"^1.1.5","auto-changelog":"^2.3.0","eslint":"^7.27.0","nyc":"^10.3.2","safe-publish-latest":"^1.1.4","semver":"^6.3.0","tape":"^5.2.2"},"directories":{"test":"test"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"dependencies":{"call-bind":"^1.0.2"},"testling":{"files":"test/index.js"},"gitHead":"6a7ceb0f0315fe26143cfbe1b7f5972c5cd6a008","_id":"has-dynamic-import@1.1.0","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"shasum":"b80761f247e7aabcb30c140db79265760dada76a","size":4800,"noattachment":false,"key":"/has-dynamic-import/-/has-dynamic-import-1.1.0.tgz","tarball":"http://name.csiicloud.com:7001/has-dynamic-import/download/has-dynamic-import-1.1.0.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/has-dynamic-import_1.1.0_1622441268682_0.08644742009449202"},"_hasShrinkwrap":false,"publish_time":1622441268783,"_cnpm_publish_time":1622441268783,"_cnpmcore_publish_time":"2021-12-13T08:25:57.950Z"},"1.0.1":{"name":"has-dynamic-import","version":"1.0.1","description":"Does the current environment have `import()` support?","main":"index.js","browser":"./browser.js","exports":{".":[{"browser":"./browser.js","default":"./index.js"},"./index.js"],"./package.json":"./package.json"},"scripts":{"prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=.js,.mjs .","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/inspect-js/has-dynamic-import.git"},"keywords":["import","dynamic","modules","esm","javascript","ecmascript","esmodules"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/inspect-js/has-dynamic-import/issues"},"homepage":"https://github.com/inspect-js/has-dynamic-import#readme","devDependencies":{"@ljharb/eslint-config":"^17.6.0","aud":"^1.1.5","auto-changelog":"^2.2.1","eslint":"^7.26.0","nyc":"^10.3.2","safe-publish-latest":"^1.1.4","semver":"^6.3.0","tape":"^5.2.2"},"directories":{"test":"test"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"gitHead":"a2a1cb9b83b326677f08a95bbe7a4ca8b147ef4a","_id":"has-dynamic-import@1.0.1","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"shasum":"385d91d78244c523f0fe0157eaf1e9750ef3845f","size":4200,"noattachment":false,"key":"/has-dynamic-import/-/has-dynamic-import-1.0.1.tgz","tarball":"http://name.csiicloud.com:7001/has-dynamic-import/download/has-dynamic-import-1.0.1.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/has-dynamic-import_1.0.1_1620964852893_0.0010458309500265273"},"_hasShrinkwrap":false,"publish_time":1620964853023,"_cnpm_publish_time":1620964853023,"_cnpmcore_publish_time":"2021-12-13T08:25:58.328Z"},"1.0.0":{"name":"has-dynamic-import","version":"1.0.0","description":"Does the current environment have `import()` support?","main":"index.js","browser":"./browser.js","exports":{".":[{"browser":"./browser.js","default":"./index.js"},"./index.js"],"./package.json":"./package.json"},"scripts":{"prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=.js,.mjs .","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/inspect-js/has-dynamic-import.git"},"keywords":["import","dynamic","modules","esm","javascript","ecmascript","esmodules"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/inspect-js/has-dynamic-import/issues"},"homepage":"https://github.com/inspect-js/has-dynamic-import#readme","devDependencies":{"@ljharb/eslint-config":"^17.6.0","aud":"^1.1.5","auto-changelog":"^2.2.1","eslint":"^7.26.0","nyc":"^10.3.2","safe-publish-latest":"^1.1.4","semver":"^6.3.0","tape":"^5.2.2"},"directories":{"test":"test"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"gitHead":"4efc0e61b58c199f7b4e681082563d4b2a9fe0f2","_id":"has-dynamic-import@1.0.0","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"shasum":"d37e6eb37052d8727b8ae227d8924b5ad2099482","size":4124,"noattachment":false,"key":"/has-dynamic-import/-/has-dynamic-import-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/has-dynamic-import/download/has-dynamic-import-1.0.0.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/has-dynamic-import_1.0.0_1620963751256_0.14283432669329277"},"_hasShrinkwrap":false,"publish_time":1620963751398,"_cnpm_publish_time":1620963751398,"_cnpmcore_publish_time":"2021-12-13T08:25:58.715Z"}},"readme":"# has-dynamic-import <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![dependency status][deps-svg]][deps-url]\n[![dev dependency status][dev-deps-svg]][dev-deps-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nDoes the current environment have `import()` support?\n\nAt the time of this writing, node v12.17+, v13.2+ and v14.0+ has support for dynamic [`import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#dynamic_imports); the syntax is supported in node v10+.\n\nThe 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.\n\nThe 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.\n\n## Tests\n\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/has-dynamic-import\n[npm-version-svg]: https://versionbadg.es/inspect-js/has-dynamic-import.svg\n[deps-svg]: https://david-dm.org/inspect-js/has-dynamic-import.svg\n[deps-url]: https://david-dm.org/inspect-js/has-dynamic-import\n[dev-deps-svg]: https://david-dm.org/inspect-js/has-dynamic-import/dev-status.svg\n[dev-deps-url]: https://david-dm.org/inspect-js/has-dynamic-import#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/has-dynamic-import.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/has-dynamic-import.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/has-dynamic-import.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=has-dynamic-import\n[codecov-image]: https://codecov.io/gh/inspect-js/has-dynamic-import/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/inspect-js/has-dynamic-import/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-dynamic-import\n[actions-url]: https://github.com/inspect-js/has-dynamic-import/actions\n","_attachments":{},"homepage":"https://github.com/inspect-js/has-dynamic-import#readme","bugs":{"url":"https://github.com/inspect-js/has-dynamic-import/issues"},"license":"MIT"}