Node js readFile to String发出声音

Node js readFile toString making sounds

本文关键字:声音 String to js readFile Node      更新时间:2023-09-26

我只有一些基本的HTML:

[...]<body>
<p>Some Text</p>
<img src="path/nodejs.jpg?">
</body>[...]

一个基本的节点js作为服务器的请求回调函数。

 fs.readFile(filePath, function(err, content){
       if (err) throw err;
        // * console.log(content.toString());
        var mime = require('mime').lookup(filePath);
        res.setHeader('Content-Type', mime + "; charset=utf-8");
        res.end(content);
    });

我想控制台日志(*line)内容,但当我这样做时,我的笔记本电脑开始发出哔哔声,即发出声音。那么,为什么会发生这种情况呢?

7的二进制字节,通过控制台显示为ASCII文本,会发出嘟嘟声。

示例:console.log(String.fromCharCode(7))

在上阅读更多信息https://en.wikipedia.org/wiki/Bell_character

如今,遇到它往往是一场烦人的事故,而不是有用的事情。