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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@icanvas/apis

v1.0.0-beta.3

Published

这是icanvas的Api功能包

Readme

iCanvas的Api功能包

Canvas

支持:微信/Web

let main = Canvas('main');//获取首个Canvas元素
let shared = Canvas('shared');//获取微信开放域内部的Canvas根元素
let share = Canvas('share');//获取微信开放域Canvas元素
let canvas = Canvas();//生成一个Cnavas元素

Canvas.main 载入后自动生成首个Canvas元素


Request

支持:微信/Web

let url = '请求地址';
let data = {};//请求参数
Request.post(url,data).then((e)=>console.log(e))
Request.get(url,data).then((e)=>console.log(e))

Request.baseURL 请求地址前缀

Request.baseData 请求默认参数

Request.post(url,data) 发起post请求

Request.get(url,data) 发起get请求


Storage

支持:微信/Web

Storage.Get('缓存键').then((e)=>console.log(e))
Storage.Set('缓存键','缓存参数').then((e)=>console.log(e))
let data = Storage.GetSync('缓存键')
Storage.SetSync('缓存键',data)

注:使用localStorage缓存


System

支持:微信/Web

System() 缓存系统信息引入时自动第一次执行

System.pixel 屏幕像素比

System.width 屏幕宽

System.height 屏幕高

System.ratio 屏幕宽高比


Toast

支持:微信(showToast)/Web(alert)

Toast({title:'提示内容'}) 默认系统提示


Font

支持:微信/Web

Font(字体地址) 载入字体地址获得字体名


Navigate

支持:微信

Navigate(appid,extends) 小程序跳转


Share

支持:微信

Share(分享配置,动态参数) 微信分享

Share.On(分享配置,动态参数) 微信右上角胶囊分享

Share.Key = 'shareAppMessage' 分享使用的微信接口

Share.On.Key = 'onShareAppMessage' 胶囊分享使用的微信接口


Login

支持:微信

Login(true).then(res=>console.log(res))

Login(true) 微信登陆(是否需要用户信息)

注:登陆失败将产生一个全屏透明的登陆按钮


File

支持:微信

File.basePath 用户文件地址前缀

注:同微信FileSystemManager