当前位置:网站首页>node-fetch下载文件
node-fetch下载文件
2022-06-22 20:50:00 【紫微前端】
var fetch = require("node-fetch");
var fs = require("fs");
function download(u, p) {
return fetch(u, {
method: 'GET',
headers: { 'Content-Type': 'application/octet-stream' },
}).then(res => res.buffer()).then(_ => {
fs.writeFile(p, _, "binary", function (err) {
console.log(err || p);
});
});
}
=======
var url = "https://nodejs.org/dist/v8.9.4/node-v8.9.4-win-x64.zip";
download(url, url.split("/").reverse()[0])边栏推荐
- 获取鼠标移动的方向
- How much do you know about the cause of amplifier distortion?
- 新捷途X70S上市8.79万起,空间安全越级,不愧是网红国民大7座SUV
- 2020-12-20
- Greedy interval problem (1)
- 安装typescript环境并开启VSCode自动监视编译ts文件为js文件
- MySQL constraints
- Mysql database DML operation exercise
- A group of K overturned linked lists [disassembly / overturning / assembly of linked lists]
- Install the typescript environment and enable vscode to automatically monitor the compiled TS file as a JS file
猜你喜欢

Spark RDD Programming Guide(2.4.3)

The relationship between derivative and differential of function

Reinforcement learning weekly (issue 50): saferl kit, gmi-drl, rp-sdrl & offline meta reinforcement learning
![Next permutation [give play to subjective initiative to discover laws]](/img/bb/262e1a21e4babb8d221d737ced3bcc.png)
Next permutation [give play to subjective initiative to discover laws]

2021-08-21

2021-03-06

mysql主从同步及其分库分表基本流程

The xinjietu x70s has been listed for 87900 times and has leapfrogged the class in space safety. It is worthy of being a 7-seat SUV of the National University of China

What are the indicators, dimensions and models in Business Intelligence BI data warehouse?

Grafana report display of sentinel based high availability current limiting system
随机推荐
Greedy interval problem (1)
Practice brings true knowledge: the strongest seckill system architecture in the whole network is decrypted. Not all seckills are seckills!!
2021-08-22
Phantomjs utility code snippet (under continuous update...)
Enabling partners, major guarantee of Spring Festival "non-stop"
2020-12-04
2020-12-04
2020-12-20
2021-05-02
数据库访问工具简介
获取鼠标移动的方向
Spark RDD Programming Guide(2.4.3)
SourceTree版本管理常用操作
The xinjietu x70s has been listed for 87900 times and has leapfrogged the class in space safety. It is worthy of being a 7-seat SUV of the National University of China
Common operations of sourcetree version management
2021-08-21
LinkedList source code analysis
What are the indicators, dimensions and models in Business Intelligence BI data warehouse?
What are the methods of software stress testing and how to select a software stress testing organization?
Help customers' digital transformation and build a new operation and maintenance system