Skip to content
Node.js
About this documentation
Usage and example
Assertion testing
Asynchronous context tracking
Async hooks
Benchmark runner
Buffer
C++ addons
C/C++ addons with Node-API
C++ embedder API
Child processes
Cluster
Command-line options
Console
Crypto
Debugger
Deprecated APIs
Diagnostics Channel
DNS
Domain
Environment Variables
Errors
Events
File system
FFI
Globals
HTTP
HTTP/2
HTTPS
Inspector
Internationalization
Iterable Streams API
Modules: CommonJS modules
Modules: ECMAScript modules
Modules:
node:module
API
Modules: Packages
Modules: TypeScript
Net
OS
Path
Performance hooks
Permissions
Process
Punycode
Query strings
Readline
REPL
Report
Single executable applications
SQLite
Stream
String decoder
Test runner
Timers
TLS/SSL
Trace events
TTY
UDP/datagram
URL
Utilities
V8
Virtual File System
VM
WASI
Web Crypto API
Web Streams API
Worker threads
Zlib
Code repository and issue tracker
Node.js v26.9.0 documentation
Node.js v26.9.0
Table of contents
Modules: Packages
Introduction
Determining module system
Introduction
Syntax detection
Module resolution and loading
package.json
and file extensions
--input-type
flag
Package entry points
Main entry point export
Subpath exports
Extensions in subpaths
Path Rules and Validation for Export Targets
Targets must be relative URLs
No path traversal or invalid segments
Exports sugar
Subpath imports
Subpath patterns
Conditional exports
Nested conditions
Resolving user conditions
Community Conditions Definitions
Self-referencing a package using its name
Dual CommonJS/ES module packages
Package maps
Configuration file format
Resolution algorithm
Multiple package versions