diff --git a/content/cli/v10/configuring-npm/package-json.mdx b/content/cli/v10/configuring-npm/package-json.mdx index f87efbfb11d..acacc8ddb0e 100644 --- a/content/cli/v10/configuring-npm/package-json.mdx +++ b/content/cli/v10/configuring-npm/package-json.mdx @@ -204,6 +204,28 @@ Both email and url are optional either way. npm also sets a top-level "maintainers" field with your npm user info. +### type + +This _optional_ field of value _string_ helps Node.js determine the module format used in the package, affecting _import_ and _export_ behavior. + +By default, Node.js utilizes the [CommonJS modules](https://nodejs.org/docs/latest/api/modules.html#modules-commonjs-modules) system for files with a `.js` or `.cjs` extension regardless whether the `type` field was provided or not. To use the modern [ECMAScript modules](https://nodejs.org/docs/latest/api/esm.html) (AKA ES modules) system, a `.mjs` file extension is required. + +In a package.json file, the `type` field currently accepts two values: + +- `commonjs` (default): Specifies that `.js` files within the package should be treated as CommonJS modules. + +- `module`: Specifies that `.js` files within the package should be treated as ES modules. + +Example: + +```json +// ECMAScript +{ +"type": "module" +} + +``` + ### funding You can specify an object containing a URL that provides up-to-date information about ways to help fund development of your package, a string URL, or an array of objects and string URLs: diff --git a/src/components/page-footer.js b/src/components/page-footer.js index 301509b34b8..6b3fa372a5b 100644 --- a/src/components/page-footer.js +++ b/src/components/page-footer.js @@ -36,11 +36,13 @@ const Contributors = ({contributors = [], latestCommit}) => { {contributors.length} {pluralize('contributor', contributors.length)} {contributors.map(login => ( - - - - - +
  • + + + + + +
  • ))} {latestCommit ? (