From 7d36d6420f1593a0b41dd3569318272bfedcb9e9 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Mon, 11 Feb 2019 00:26:38 +0200 Subject: [PATCH] esm: top-level --type, -m flags, spec updates --- doc/api/cli.md | 12 ++++++++++++ doc/api/esm.md | 28 ++++++++++++++++++++-------- doc/node.1 | 3 +++ 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index ec79a925e4..a70eeb7698 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -492,6 +492,18 @@ added: v2.4.0 Track heap object allocations for heap snapshots. +### `-m`, `--type=type` + +When using `--experimental-modules`, this informs the module resolution type +to interpret the top-level entry into Node.js. + +Works with stdin, `--eval`, `--print` as well as standard execution. + +Valid values are `"commonjs"` and `"module"`, where the default is to infer +from the file extension and package type boundary. + +`-m` is an alias for `--type=module`. + ### `--use-bundled-ca`, `--use-openssl-ca`