-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
36 lines (25 loc) · 886 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const http = require('http')
const URL = require("url").URL;
const qs = require("querystring");
const config = require("./wet.config.json");
console.log(config.servicer);
console.log(qs.stringify({ q: ["lisi", "zs"] }));
const url = new URL("http://api.fanyi.baidu.com/api/trans/vip/translate");
url.search =
"q=apple&from=auto&to=auto&appid=20210921000952000&salt=azin-cn&sign=3a8736c54facc924ce09292957b78757";
// console.log(url)
const client = http.get(url, res => {
})
client.on('error', err => {
console.log('错误')
})
// console.log(encodeURI(`${1+"\n"}`))
console.log(
["Hello", "World"].reduce((words, word) => {
return words + "\n" + word;
}, "")
);
const s = "Hello";
console.log(`%c${s}`, "color: red;");
console.log("\033[41;30m DONE \033[40;32m .json build success\033[0m");
// console.log("\x1B[43m 原文 " + "\x1B[40;33m " + l1 + "\033[0m");