.mjs JavaScript program
Text & source code
| MIME type | text/javascript |
|---|---|
| Description | JavaScript program |
| Category | Text & source code |
| Signature (magic bytes) | 23 21 20 2F 62 69 6E 2F 67 6A 73 (#! /bin/gjs)23 21 20 2F 75 73 72 2F 62 69 6E 2F 67 6A 73 (#! /usr/bin/gjs)23 21 2F 62 69 6E 2F 67 6A 73 (#!/bin/gjs) |
| Based on | application/x-executable, text/plain |
| Other extensions | .js, .jsm |
Frequently asked questions
What is a .mjs file?
A .mjs file is a “JavaScript program” (MIME type text/javascript).
How do I open a .mjs file?
With any text editor – Notepad++, Visual Studio Code, or gedit and vim on Linux. The file contains readable text, possibly source code or configuration.
How can you tell a genuine .mjs file?
By the bytes at the start of the file, the signature (magic bytes): 23 21 20 2F 62 69 6E 2F 67 6A 73 (#! /bin/gjs), 23 21 20 2F 75 73 72 2F 62 69 6E 2F 67 6A 73 (#! /usr/bin/gjs) and 23 21 2F 62 69 6E 2F 67 6A 73 (#!/bin/gjs). On Linux and macOS, file --mime-type example.mjs checks the real type regardless of the extension.
Which format is .mjs based on?
Technically a .mjs file is a subtype of “Executable” (application/x-executable), so programs for that base format can often read it too.
Which MIME type belongs to .mjs?
The MIME type is text/javascript. In the Apache web server: AddType text/javascript .mjs; in nginx: types { text/javascript mjs; }.