Comments (2)
const fs = require('fs')
const file = fs.readFileSync('huge_file.txt')
process.stdout.write(file)
// process.exit(0)
以上代码,注释exit
正常;
加上exit
,输出只有255.8 kB
。
所以,在没有异常时不使用exit
,原因待查
from wechat-web-devtools-linux.
看文档:https://nodejs.org/api/process.html#processexitcode
Calling
process.exit()
will force the process to exit as quickly as possible even if there are still asynchronous operations pending that have not yet completed fully, including I/O operations toprocess.stdout
andprocess.stderr
.
stdout
没完成会被强行终止,呜呜呜
In most situations, it is not actually necessary to call
process.exit()
explicitly. The Node.js process will exit on its own if there is no additional work pending in the event loop. Theprocess.exitCode
property can be set to tell the process which exit code to use when the process exits gracefully.
使用process.exitCode
优雅地解决遇到错误要输出错误信息与错误代码。
from wechat-web-devtools-linux.
Related Issues (20)
- 可以支持一下Deepin Linux的深度桌面。
- 启动hello world,模拟器空白,日志提示json语法错误 HOT 2
- 报错 Uncaught SyntaxError: Unexpected token ']' 和Uncaught ReferenceError: $gwx is not defined HOT 3
- 请教一下,有没有办法在使用appimage的情况下调用wechat-devtools-cli HOT 8
- selinux disable HOT 2
- 能不能关闭软件的更新检测?? HOT 3
- docker-compose up错误,gyp built error HOT 9
- debian12系统下, 启用工具后,有三个弹窗提示“Couldn't start client Skyline Style Server",“A request has failed. See the output for more information.”. HOT 1
- Win 系统的最新版的上一个版本(大概两周前的版本)存在BUG,建议升级下
- [skyline] 此功能不可使用的一些说明 HOT 1
- 编译报错 HOT 2
- 编译问题,无法编译WXSS文件 HOT 11
- 报错了,但是windows的开发者工具打开同一个项目是没有报错的 HOT 4
- fedora38 界面乱码 HOT 5
- manjaro kde下安装报错 HOT 3
- 使用appImage打开后,控制台报错$gwx is not defined HOT 8
- WXML 文件编译错误 HOT 1
- $gwx 的函数错误 HOT 4
- 导入不了已有项目 HOT 7
- [Bug] 导入按钮第二次点击无效 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wechat-web-devtools-linux.