What is a .MJS file?
MJS is a JavaScript file that uses ES modules - the extension tells Node.js to treat it as a module with import and export rather than CommonJS.
- Did you know
- Node.js added .mjs to settle the long clash between import/export modules and the require() system it grew up with.
- Node.js uses the .mjs extension to force ECMAScript module mode, with .cjs forcing the older CommonJS, resolving years of ambiguity over which a .js file is.
- ES modules became an official part of JavaScript in 2015 and are the standard way browsers load script as modules too.
- What Analyser shows you
- Preview and inspect HTML, CSS, JavaScript, TypeScript, JSON, YAML, XML and Markdown source files, plus Windows scripts. TypeScript (TS, MTS, and .d.ts declaration files) gets a structure readout beside the source: the modules it imports (packages against local files, and which are type-only), the names it exports, what it declares - interfaces, type aliases, enums, classes, functions - a code/comment/blank line breakdown, and how often it steps around the type system with any, as casts, non-null assertions and @ts- suppressions. PowerShell (PS1, PSM1, PSD1) is read for its comment-based help synopsis, #Requires directives, function and parameter counts, CmdletBinding and Authenticode signing; batch/command scripts (BAT, CMD) for the echo state, labels, variables set and the external tools they invoke.
- Open a .MJS file
- Drag a .MJS file onto the Analyser home page (or tap to pick one). It opens entirely in your browser - nothing is uploaded, there is no account, and it works offline once installed.