deno 安装第三方库解决any问题
例如:
import express from "npm:express@4";
const app = express();
app.get("/", (request, response) => {
response.send("Hello World");
});
app.listen(3000, () => {
console.log("Server is running on port 3000");
});
默认app常量是any类型
// @deno-types="npm:@types/express@4"
import express from "npm:express@4";
const app = express();
app.get("/", (request, response) => {
response.send("Hello World");
});
app.listen(3000, () => {
console.log("Server is running on port 3000");
});
使用 // @deno-types=“npm:@types/express@4” 默认导入类型
并且需要执行deno info npm:@types/express@4去初始化。
在这里插入图片描述
配置完成。