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

fzm

v1.5.5

Published

https://www.33.cn

Downloads

216

Readme

fzm

https://www.33.cn

安装

npm install --save fzm

restfuls、sp_restfuls的使用

import {restfuls,sp_restfuls} from 'fzm'; //如果接口返回规范的数据格式(详情请看后面)那么使用restfuls,如果是不规范的则使用sp_restfuls
const api = {
  getRegisterState(params){ //判断是否已注册。注意!get方式的请求params外面需要包裹一个大括号
    return restfuls.get(注册的接口地址,{ params });
  },
  login(params){ //快速登录
    return restfuls.post(快速登录的接口地址,params);
  },
  getKlineDate(params) { //获取k线数据 `这个接口返回的数据格式是不规范的,所以使用sp_restfuls`
    return sp_restfuls.get(chartOrigin + "/kdata", {params});
  },
}

想要使用restfuls方法,则必须要求接口返回的数据格式符合如下结构:

{
  code:200,
  data:{
    ...
  },
  message:"..."
}

notyf的使用

import {notyf} from 'fzm';
notyf.confirm("成功!")
notyf.alert("失败!")

date的使用

import {date} from 'fzm';
let time = date.format("Y-M-D h:m:s",new Date().getTime()); // 2018-6-20 13:12:23

object的使用

let o = {
  a:'aaa',
  b:'bbb'
}

object.hasOwnProps(o,'a','b');

同时支持以下的使用方式

import fzm from 'fzm';
fzm.notyf.confirm("成功!")
fzm.notyf.alert("失败!")

功能完成情况

  • [x] ~~object~~
  • [x] ~~date~~
  • [x] ~~notyf~~
  • [x] ~~restfuls~~
  • [x] ~~sp_restfuls~~

发现BUG