{"success":true,"data":{"ext":"js","name":"JS","description":"JavaScript (JS) is a text-based scripting language standardized by ECMA International through the TC39 committee. It is used to add interactive behavior to web pages and is also employed in server-side applications, browser extensions, and automation scripts. Because JavaScript can execute code in client environments and is often distributed through untrusted sources, files should be reviewed carefully; older documentation sometimes uses the historical MIME type text/javascript.","mime":["text/javascript"],"risk_level":"High","signatures":[{"hex":"2F 2A 20 6A 51 75 65 72 79 20","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"2F 2A 21 20 6A 51 75 65 72 79 20","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"2F 2A 21","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"28 66 75 6E 63 74 69 6F 6E 28 65 2C 75 6E 64 65 66 69 6E 65 64 29 7B","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"21 66 75 6E 63 74 69 6F 6E 28 77 69 6E 64 6F 77 2C 75 6E 64 65 66 69 6E 65 64 29 7B","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"2F 2A 20 20 50 72 6F 74 6F 74 79 70 65 20 4A 61 76 61 53 63 72 69 70 74 20","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"76 61 72 20 50 72 6F 74 6F 74 79 70 65 3D 7B","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"66 75 6E 63 74 69 6F 6E 20 24 77 28 74 29 7B","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"2F 2A 2A 20 40 6C 69 63 65 6E 73 65 20 52 65 61 63 74","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"2F 2A 2A","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]}],"related":["mjs","cfg","htm","html","xhtml","xml"],"usage":{"python":"def is_js(file_path: str) -> bool:\n    \"\"\"Check if file is a valid JS by magic bytes.\"\"\"\n    signature = bytes([0x2F, 0x2A, 0x20, 0x6A, 0x51, 0x75, 0x65, 0x72, 0x79, 0x20])\n    with open(file_path, \"rb\") as f:\n        return f.read(10) == signature","node":"function isJS(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x2F, 0x2A, 0x20, 0x6A, 0x51, 0x75, 0x65, 0x72, 0x79, 0x20]);\n  return buffer.subarray(0, 10).equals(signature);\n}","go":"func IsJS(data []byte) bool {\n    signature := []byte{0x2F, 0x2A, 0x20, 0x6A, 0x51, 0x75, 0x65, 0x72, 0x79, 0x20}\n    if len(data) < 10 {\n        return false\n    }\n    return bytes.Equal(data[:10], signature)\n}"},"category":"Web & Config"}}