npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tb-pc-api

v0.0.3

Published

使用 Ts 重新定义淘宝PC小程序的api, 并将其改成 Promise 形式

Downloads

6

Readme

tb-pc-api

简介

使用 TS 重新定义淘宝小程序的 api, 并将其改成 Promise 形式。

npm package GitHub stars GitHub forks NPM downloads GitHub issues

安装

yarn add tb-pc-api
// 或
npm i tb-pc-api

特点

  • 支持 TypeScript
  • 所有异步的 api 都换成了 Promise 的形式
  • 官方开发者工具中支持鼠标上移显示函数的定义
  • 入参和原 api 保持不变,只是去掉了 success、fail、complete 这三个方法。
  • 所有 API 名字与官方保持一致

注意

小程序 PC 端 API 的官方文档描述不一定准确,以实际的调用为准。 使用过程中,如有疑问,可以先使用原生 API 试试。

例子

import { alert } from 'tb-pc-api';

alert({ title: '你好', content: '我是个demo', buttonText: 'OK' });