Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@v6.0.1
- name: Setup Node
uses: actions/setup-node@v4.3.0
uses: actions/setup-node@v6.2.0
with:
node-version: ${{ matrix.version }}
- name: Install Dependencies
run: npm ci
- name: Save error log
uses: actions/upload-artifact@v4.6.2
uses: actions/upload-artifact@v6.0.0
if: ${{ failure() }}
with:
name: npm-debug-log-${{ hashFiles('package-lock.json') }}
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Test
run: npm test
- name: Report Coverage
uses: codecov/codecov-action@v5.5.1
uses: codecov/codecov-action@v5.5.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Pack
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@v6.0.1
- name: Setup Node
uses: actions/setup-node@v4.3.0
uses: actions/setup-node@v6.2.0
with:
node-version: '24.11.1'
- name: Install Dependencies
run: npm ci
- name: Save error log
uses: actions/upload-artifact@v4.6.2
uses: actions/upload-artifact@v6.0.0
if: ${{ failure() }}
with:
name: npm-debug-log-${{ hashFiles('package-lock.json') }}
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Pack
run: npm pack
- name: Push to NPM registry
uses: JS-DevTools/npm-publish@v4.1.1
uses: JS-DevTools/npm-publish@v4.1.5
with:
access: public
tag: ${{ contains(github.ref, '-') && 'next' || 'latest' }}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
[![codecov](https://codecov.io/gh/knightedcodemonkey/module/graph/badge.svg?token=AjayQQxghy)](https://codecov.io/gh/knightedcodemonkey/module)
[![NPM version](https://img.shields.io/npm/v/@knighted/module.svg)](https://www.npmjs.com/package/@knighted/module)

Node.js utility for transforming a JavaScript or TypeScript file from an ES module to CommonJS, or vice versa.
Node.js utility for transforming a JavaScript or TypeScript file from CommonJS to an ES module, or vice versa.

- ES module ➡️ CommonJS
- CommonJS ➡️ ES module
- ES module ➡️ CommonJS

Highlights

- ESM ➡️ CJS and CJS ➡️ ESM with one function call.
- CJS ➡️ ESM and ESM ➡️ CJS with one function call.
- Defaults to safe CommonJS output: strict live bindings, import.meta shims, and specifier preservation.
- Configurable lowering modes: full syntax transforms or globals-only.
- Specifier tools: add extensions, add directory indexes, or map with a custom callback.
Expand All @@ -25,7 +25,7 @@ By default `@knighted/module` transforms the one-to-one [differences between ES

## Requirements

- Node 22 or 24 (tested on 22.21.1 and 24.11.1)
- Node 22.21.1+ or 24+

## Install

Expand Down
Loading