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

onic

v1.0.1

Published

豆包网API平台接入JavaScript SDK

Readme

ONIC

豆包网API平台接入JavaScript SDK

基础配置

使用之前请先进行全局配置

<!--全局设置-->
const config = {
	appKey: '11111',
	appSerect: '221sd1daa',
	gateway: 'http://xxx.com/aaa',
	publicKey: '/keys/publick.pem',
	privateKey: '/keys/private.pem',
	format: 'json',
	signType: 'RSA',
	charset: 'UTF-8',
	version: '1.0.0',
	encrypt: 1
}
const onic = new Onic(config)
const data = {
	      productCode: '111',
	      aroductId: 123
      }
const res = await onic.post(serviceName, data)
console.log(res)

发送请求

onic.post(serviceName, data, customerConfig)

  • serviceName 必填

    string类型,你需要请求的服务名称

  • data 必填

    object类型,你需要请求的数据

  • customerConfig 选填

    object类型,可以自定义配置

    • format: 报文格式 默认json
    • signType: 签名类型,目前支持RSA,MD5
    • charset: 字符编码,目前只支持UTF-8
    • version: api版本号,默认1.0.0
    • encrypt: content是否进行RSA加密,如果请求加密,那么响应也是加密的,1加密,0不加密 目前不支持加密,请在全局设置成0

公钥加密

暂不支持

开发中

  • 公钥加密
  • 公钥解密
  • 私钥加密
  • 私钥解密