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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ithinkdt/configit

v1.0.0

Published

## 简介

Downloads

6

Readme

敏桥 Cofingit-SDK

简介

针对 configit 平台推出的前端 jssdk,使用基于 es6-Promise 的 api 调用方式,兼容主流 pc 浏览器、移动端 web、微信小程序平台。npm 包安装,极速方便集成,体积小巧,压缩版(10kb)。

兼容性

  • PC 端:IE >= 9 及主流浏览器
  • 移动端:IOS > 8.0, Android > 4.0
  • 微信小程序平台

安装

npm i -S @ithinkdt/configit

初始化

  • 方法 create

  • 参数

    | 名称 | 必填 | 说明 | | ---- | ---- | -------- | | url | 是 | 服务地址 |

  • 返回
    sdk 实例化对象

  • 示例

    // import
    import ConfigitSDK from '@ithinkdt/configit'
    // init
    const instance = ConfigitSDK.create({
      url: 'https://demo.clm-dev.cloud',
      headers: {
        Token: 'token',
      },
    })

实例对象 API

获取资源包列表

  • 方法 packages

  • 参数

    | 名称 | 必填 | 说明 | | --------------- | ---- | ------------------------ | | pathPrefix | | 资源包路径前辍,默认:'' | | includeVersions | | 是否包含版本 默认:false |

  • 返回 json

    | 名称 | 说明 | | -------- | ---------- | | packages | 资源包列表 |

  • 示例

// 获取资源包列表
instance
  .packages({
    pathPrefix: '',
    includeVersions: false,
  })
  .then((res) => {
    console.log(res)
  })

获取语言列表

  • 方法 languages

  • 参数

    | 名称 | 必填 | 说明 | | ----------- | ---- | ---------- | | packagePath | 是 | 资源包路径 |

  • 返回 json

    | 名称 | 说明 | | ----------- | ---------- | | packagePath | 资源包路径 | | languages | 语言列表 |

  • 示例

// 获取语言列表
instance
  .languages({
    packagePath: 'ace-samples/ace-model',
  })
  .then((res) => {
    console.log(res)
  })

获取产品列表

  • 方法 products

  • 参数

    | 名称 | 必填 | 说明 | | ----------- | ---- | ---------- | | packagePath | 是 | 资源包路径 | | searchTerm | | 搜索关键词 | | language | | 语言 |

  • 返回 json

    | 名称 | 说明 | | ----------- | ---------- | | packagePath | 资源包路径 | | products | 产品列表 |

  • 示例

// 获取产品列表
instance
  .products({
    packagePath: 'ace-samples/ace-model',
    searchTerm: '',
    language: 'ZH_CN',
  })
  .then((res) => {
    console.log(res)
  })

获取产品详情

  • 方法 product

  • 参数

    | 名称 | 必填 | 说明 | | ----------- | ---- | ---------- | | packagePath | 是 | 资源包路径 | | id | 是 | 产品 ID |

  • 返回 json

    | 名称 | 说明 | | ------- | -------- | | product | 产品详情 |

  • 示例

// 获取产品详情
instance
  .product({
    packagePath: 'ace-samples/ace-model',
    id: 'X0',
  })
  .then((res) => {
    console.log(res)
  })

获取配置

  • 方法 configure

  • 参数

    | 名称 | 必填 | 说明 | | ------------------------------------- | ---- | ---------------- | | packagePath | 是 | 资源包路径 | | date | 是 | 当前日期 | | line | 是 | 选择的产品及条件 | | line.productId | 是 | 产品 id | | line.variableAssignments[] | 是 | 选中的信息 | | line.variableAssignments[].variableId | | 行 id | | line.variableAssignments[].value | | 列的值 | | language | | 语言 |

  • 返回 json

    | 名称 | 说明 | | ----------- | ---------- | | packagePath | 资源包路径 | | sections | 配置信息 |

  • 示例

// 获取配置
instance
  .configure({
    packagePath: 'ace-samples/ace-model',
    date: new Date(),
    language: 'ZH_CN',
    line: {
      productId: 'X0',
      variableAssignments: [
        {
          variableId: 'VAR_ID',
          value: 'VALUE',
        },
      ],
    },
  })
  .then((res) => {
    console.log(res)
  })