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

@styleofpicasso/client

v0.1.7

Published

a plugin of request base axiso

Readme

1. 安装 与 引入
// 安装 
npm install @styleofpicasso/client --save-dev
或
yarn add @styleofpicasso/client

// 引入
import { Client } from '@styleofpicasso/client';
2. 使用案例
// 使用案例
import { Client } from '@styleofpicasso/client';

export class TestAPI extends Client {
    constructor() {
        super(getway, options: {})
    }
    
    // 获取数据
    getData(param) {
        return this.post('/test/...', param)
    }
}
3. 详细说明
  • 这个服务支持 post/ get / put / delete 这四个方法
// 这里的四个方法都只接受三个参数
url: 请求接口地址
data: 请求参数
options: 请求接口的相应配置信息
  • 以上案例中的getway 是我们请求接口中代理的服务字段
// eg:
proxy : {
    '/api': {
        target: 'http:// ...',
        ....
    }
}
// 服务中的 的继承就是
constructor() {
    super('/api')
}
  • options 配置信息
// 这里的 options 的配置信息包含以下
oprions: {
  // 这些封装里已经默写 
  underscoreRequestData: false,  // 是否将请求参数改成下划线的方式传递给后端
  camelizeResponseData: true, // 是否将后端返回的数据处理成驼峰式
  dataType: 'form' // json || form || multipart (json格式, 正常的form表单格式,上传文件)
  // 这里需要就加
  responseType: 'blob',  // 响应的类型, 上传时可以用到
  timeout: 10000,  // 超时时间
  .....
}