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

smms

v1.0.7

Published

smms 图床插件

Readme

smms

sm.ms 图床上传插件

安装

npm install smms

使用

// es6 
// import uploadImg from 'smms';
// require
const uploadImg = require('smms');
// file 应为 input[type=file] 拿到的 fileList 中的其中一个文件
uploadImg(file).then(data=>{
    // todo
});

// 在 jquery 中使用的例子
// html:  <input type="file" id="input">
const input = $('#input');

input.on('change', function (e) {
    if(e.target.files.length > 0){
        uploadImg(e.target.files[0]).then(data => {
            console.log(data);
        });
    }
});

返回数据说明

错误列表

响应示例

  1. 成功示例
{
    "code": "success",
    "data": {
        width: 1157,
        height: 680,
        filename: "image_2015-08-26_10-54-48.png",
        storename: "56249afa4e48b.png",
        size: 69525,
        path: "/2015/10/19/56249afa4e48b.png",
        hash: "nLbCw63NheaiJp1",
        timestamp: 1445239546,
        url: "https://ooo.0o0.ooo/2015/10/19/56249afa4e48b.png",
        delete: "https://sm.ms/api/delete/nLbCw63NheaiJp1"
    }
}
  1. 失败示例
{
    code: "error",
    msg: "No files were uploaded."
}

其他 API

  1. 上传历史
import {list} from 'smms';
list().then(({code,data})=>{
    console.log(data);    
})
  1. 清除历史上传
import {clear} from 'smms';
clear().then(({code,data})=>{
    console.log(data);    
})
  1. 删除指定文件
import {remove} from 'smms';
remove(hash).then(({code,data})=>{
    console.log(data);    
})

详细文档请移步 https://sm.ms/doc/

感谢

感谢 sm.ms 提供的图床服务。

sm.ms 并不是我的站点。

https://github.com/96qbhy/smms
[email protected]