Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ name = "javascript"
environment = [
"nodejs",
"jest"
]
]
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tests/**/* linguist-vendored
tests/**/* linguist-vendored
2 changes: 1 addition & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 18.x]
node-version: [22.x, 20.x, 18.x]
fail-fast: true

steps:
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"printWidth": 100,
"singleQuote": true,
"bracketSameLine": false
}
}
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,18 @@ For further discussions about this issue, visit:

### 6.1. 2023-12-16

As of version 2.2.0, **import-sync** has switched from using the archived [esm](https://github.com/standard-things/esm) package to the fork [@httptoolkit/esm](https://github.com/httptoolkit/esm). For further details, please see
As of version 2.2.0, **import-sync** has switched from using the archived [esm](https://github.com/standard-things/esm) package to the fork [@httptoolkit/esm](https://github.com/httptoolkit/esm). For further details, please see:
- issue [#37](https://github.com/nktnet1/import-sync/issues/37)
- merge request [#38](https://github.com/nktnet1/import-sync/pull/38)

### 6.2. 2026-04-20

As of version 3.0.0, **import-sync** has switched to the fork [esm-sync](https://github.com/nktnet1/esm-sync).

## 7. Alternative

Jiti (Runtime TypeScript and ESM support for Node.js):

- https://github.com/unjs/jiti

While synchronous import is deprecated in Jiti, it still works reliably for many use cases.
1 change: 0 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const eslintFlatConfig = [
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},
},
},
Expand Down
54 changes: 29 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
{
"name": "import-sync",
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/nktnet1/import-sync"
},
"version": "2.2.3",
"version": "2.2.4-beta.5",
"files": [
"dist"
],
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"scripts": {
"test": "jest",
"tc": "jest --coverage",
"lint": "eslint --fix './**/*.ts'",
"tsc": "tsc --noEmit",
"build": "rm -rf dist && npm run build:esm && npm run build:cjs",
"build:esm": "tsc",
"build:cjs": "tsc --module CommonJS --outDir dist/cjs",
"build": "tsdown",
"prepublishOnly": "npm run build",
"prepare": "husky"
},
Expand All @@ -42,33 +39,40 @@
"license": "MIT",
"description": "Synchronously import dynamic ECMAScript Modules similar to CommonJS require. Basic wrapper around esm for compatibility with both ESM and CJS projects in NodeJS.",
"devDependencies": {
"@commitlint/cli": "^20.0.0",
"@commitlint/config-conventional": "^20.0.0",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.36.0",
"@types/httptoolkit__esm": "^3.3.0",
"@commitlint/cli": "^20.5.0",
"@commitlint/config-conventional": "^20.5.0",
"@eslint/eslintrc": "^3.3.5",
"@eslint/js": "^10.0.1",
"@jest/globals": "^30.3.0",
"@types/jest": "^30.0.0",
"@types/node": "^24.5.2",
"@typescript-eslint/eslint-plugin": "^8.44.1",
"@typescript-eslint/parser": "^8.44.1",
"eslint": "^9.36.0",
"@types/node": "^25.6.0",
"@typescript-eslint/eslint-plugin": "^8.58.2",
"@typescript-eslint/parser": "^8.58.2",
"eslint": "^10.2.1",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^29.0.1",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-react-refresh": "^0.4.22",
"globals": "^16.4.0",
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.5.0",
"husky": "^9.1.7",
"jest": "^30.1.3",
"node-datachannel": "^0.29.0",
"jest": "^30.3.0",
"node-datachannel": "^0.32.2",
"node-fetch": "^3.3.2",
"ts-jest": "^29.4.4",
"ts-jest": "^29.4.9",
"ts-node": "^10.9.2",
"typescript": "^5.9.2"
"tsdown": "^0.21.9",
"typescript": "^6.0.3"
},
"dependencies": {
"@httptoolkit/esm": "^3.3.2"
"esm-sync": "3.3.3"
},
"packageManager": "pnpm@10.17.1"
"packageManager": "pnpm@10.33.0",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.cts",
"exports": {
".": "./dist/index.cjs",
"./package.json": "./package.json"
}
}
Loading
Loading