🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

default-import

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

default-import - npm Package Compare versions

Comparing version

to
0.0.1-dev.0a57969be8b66a677d8d26c66409014b929198c94ccdf2a4bf6c84d3de8b140f

32

package.json
{
"name": "default-import",
"version": "0.0.0",
"version": "0.0.1-dev.0a57969be8b66a677d8d26c66409014b929198c94ccdf2a4bf6c84d3de8b140f",
"description": "Properly handle CJS imports in ESM.",

@@ -13,3 +13,3 @@ "engines": {

"repository": "jacobley/jacobley",
"homepage": "https://github.com/jacobley/jacobley/packages/default-import#readme",
"homepage": "https://github.com/JacobLey/jacobley/tree/main/tools/default-import#readme",
"bugs": {

@@ -26,12 +26,2 @@ "url": "https://github.com/jacobley/jacobley/issues"

"sideEffects": false,
"scripts": {
"build": "tsc --build",
"build:ci": "tsc",
"coverage": "npm run instrument && nyc mocha ./nyc/tests/unit",
"instrument": "nyc instrument --nycrc-path=nyc.instrument.cjs ./dist ./nyc",
"lint": "npm run -w=../.. --include-workspace-root package-lint",
"lint:fix": "npm run -w=../.. --include-workspace-root package-lint:fix",
"test": "npm run coverage",
"unit-test": "mocha ./dist/tests/unit"
},
"main": "./dist/default-import.js",

@@ -48,4 +38,18 @@ "exports": {

"devDependencies": {
"chai": "4.3.6"
"@types/chai": "4.3.1",
"@types/mocha": "9.1.1",
"@types/node": "17.0.33",
"chai": "4.3.6",
"mocha": "10.0.0",
"nyc": "15.1.0",
"typescript": "4.7.1-rc"
},
"scripts": {
"build": "tsc",
"coverage": "rushx instrument && nyc mocha ./nyc/tests/unit",
"instrument": "nyc instrument --nycrc-path=nyc.instrument.cjs ./dist ./nyc",
"lint": "rush lint-package",
"test": "rushx coverage",
"unit-test": "mocha ./dist/tests/unit"
}
}
}

@@ -75,4 +75,3 @@ <div style="text-align:center">

`defaultImport()` is idempotent and handles _correct_ so it is safe to use in environments that correctly
handle default imports. That said, it is generally overkill and unnecessary to use this library in those cases.
`defaultImport()` is idempotent and handles properly exported defaults so it is safe to use in environments that correctly provide default imports. That said, it is generally overkill and unnecessary to use this library in those cases.

@@ -88,3 +87,3 @@ It is best used when the runtime/source is not entirely in control, such as NextJS (ESM on server, "commonjs" on browser).

Idempotent, and correctly handles _proper_ default exports.
Idempotent, and correctly handles proper default exports (e.g. default import from ESM .mjs file).

@@ -91,0 +90,0 @@ ## Related Issues