
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@inceptiongt/rap-t
Advanced tools
[![MIT License][license-shield]][license-url]
Rapper 是 TypeScript 的最佳拍档,它可以帮你生成具有类型定义的请求方案。
十年前我们创立了 Rap 项目,如今已经有相当多的用户在 Rap 中管理接口文档和 Mock 数据。
Rapper 在此基础上更进一步,利用这些已经录入的接口数据为你生成 TypeScript 类型定义以及配套的数据请求方案,让你在代码开发中省去重复的劳动。
如果你还没使用过 Rap,请先去我们的官方站点:http://rap2.taobao.org/ 注册一个账户并新建一个仓库,再向下进行。
进入仓库,点击配置「生成 TS 代码」
按照指引把 Rapper 安装到项目中
执行 npm run rapper
生成代码
引入生成的 fetch 函数,调用它就能发起请求并返回带有类型的响应数据
// 从生成的代码中引入 fetch
import { fetch } from './rapper';
// 直接使用 fetch 调用请求函数,能获得请求/返回类型校验/提示
(async function() {
// alt+点击可以查看接口信息
const res = await fetch['GET/example/rapper']({
foo: '123',
});
const nameList = res.taskList.map(e => e.name);
})();
如果你使用 React 和 Redux,在以上基础的请求函数之外,Rapper 还为你提供精心设计过的全局数据管理方案。
以往发送一个请求要写繁杂的 interface/action/reducer/effect,现在这些都会为你准备好,你只需要一行代码即可:
const [responseData, { isPending, errorMessage }] = useAPI['GET/duck/fetchColor'](requestParams);
想要在生产中深度使用 Rapper,你可能还需要自定义请求函数、对返回的数据做统一的类型转换
具体请参考我们的文档:https://www.yuque.com/rap/rapper
FAQs
rapper with template
We found that @inceptiongt/rap-t demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.