{
  "id": "node-package-exports-table",
  "kind": "table",
  "slug": "node-package-exports",
  "iil_id": null,
  "note_url": "https://iinventedlight.com/library/notes/node-package-exports/",
  "title": "The package.json exports field defines a Node package's public entry points and conditions",
  "columns": [
    "name",
    "source",
    "detail"
  ],
  "rows": [
    {
      "name": "\"import\"",
      "source": "Node.js API docs",
      "detail": "matches when the package is loaded via import or import(); \"require\" matches when it is loaded via require(). The two are always mutually exclusive."
    },
    {
      "name": "\"node\"",
      "source": "Node.js API docs",
      "detail": "matches for any Node.js environment."
    },
    {
      "name": "\"default\"",
      "source": "Node.js API docs",
      "detail": "is the generic fallback that always matches and should always come last."
    },
    {
      "name": "*",
      "source": "Node.js API docs",
      "detail": "in a subpath pattern is a string replacement, so it can expose nested subpaths such as features/y/y.js. Including \"*.js\" on both sides restricts the exposed package exports to only JS files."
    }
  ],
  "related_slugs": [
    "node-subpath-imports",
    "node-esm",
    "node-commonjs-modules"
  ],
  "license": "CC-BY-4.0",
  "source_license": "MIT (Node.js API docs); MIT (Node.js Learn); prose restates cited source lines in own words",
  "as_of": "2026-11-18",
  "status": "fill-draft-20261118",
  "note": "Restated from the note's GREEN sources; check those sources before relying on a value."
}