节点js readFile toString发出声音

Node js readFile toString making sounds

我只有一些基本的 HTML:

[...]<body>

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

</body>[...]

还有一个基本的node 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);
    });

我想 console.log(* 行)内容,但是当我这样做时,我的笔记本电脑开始发出哔哔声,即发出声音。那为什么会这样呢?

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

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

https://en.wikipedia.org/wiki/Bell_character

阅读更多内容

如今,遇到它更多的是恼人的意外,而不是有用的东西。