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 🙏

© 2026 – Pkg Stats / Ryan Hefner

uniapp-image-tools

v1.0.4

Published

## 核心功能

Readme

uniapp-image-tools

核心功能

  • 路径转换:自动处理不同平台的文件路径格式
  • Base64互转:支持文件路径与Base64数据的双向转换
  • 多平台兼容:支持浏览器、uni-app、微信小程序三端运行

安装使用

npm install uniapp-image-tools
import { pathToBase64, base64ToPath } from "uniapp-image-tools";

// 浏览器环境示例
const img = document.getElementById("demo-img");
img.src = await pathToBase64("./logo.png");

API文档

pathToBase64(path: string): Promise

  • 参数:文件路径(支持相对路径和绝对路径)
  • 返回值:包含Base64数据的DataURL字符串

base64ToPath(base64: string): Promise

  • 参数:标准Base64字符串或DataURL
  • 返回值:平台对应的本地文件路径

运行环境要求

  • TypeScript 4.0+
  • Node.js 14+
  • 支持平台:
    • 浏览器(支持FileAPI的现代浏览器)
    • uni-app(需集成5+ SDK)
    • 微信小程序(基础库2.10.0+)

多平台兼容性

| 平台 | 支持版本 | 依赖条件 | | ---------- | ---------------- | ---------------------- | | 浏览器 | Chrome 76+ | 支持FileReader API | | uni-app | HBuilderX 3.1.0+ | 需添加5+模块依赖 | | 微信小程序 | 基础库2.10.0+ | 需开启「增强编译」选项 |

注意事项

  1. iOS平台需要配置manifest.json的本地路径访问权限
  2. 微信小程序需在app.json中声明writeFile权限
  3. 浏览器环境需处理跨域问题