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

ly-downloader

v1.0.5

Published

> 注:主要解决下载图片类型文件时浏览器直接打开图片不会直接下载的问题,于是封装了一个方法供自己和大家使用, 也可用于下载一般文件类型

Readme

功能:下载图片及其它类型文件的方法(兼容ie)

注:主要解决下载图片类型文件时浏览器直接打开图片不会直接下载的问题,于是封装了一个方法供自己和大家使用, 也可用于下载一般文件类型

使用时需传入3个参数:
  • type: 1 或 2( 用于判断传入的是地址还是canvas对象 )
  • data: type = 1 时传入文件地址; type = 2 时传入一个canvas对象( 配合html2canvas使用 )
  • name: 下载图片默认文件名( type = 1 时设置''为地址默认文件名, type = 2 时 name 不能为空 )
  • 注:name 参数虽然只有在下载文件类型为图片时生效,但为避免出错都需要传入一个值
  • 例:download(1, url, '') 或 download(2, canvas对象, '图片附件')
组件中使用例子
  • 先安装 ly-downloader
npm i --save ly-downloader
  • 组件中引入,以 vue 为例
import download from 'ly-downloader'
export default {
  methods: {
    // url = '你的文件地址'
    _download (url) {
      download(1, url, '文件名')
    },
  }
}

联系作者:[email protected]