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

dx-sdk

v0.1.3

Published

Dx sdk for leading dingchat

Readme

dx-js-SDK构建工程

一个简单的鼎信sdk, sdk依赖于promise,如果在不支持Promise的环境中使用该库,可能需要引入相应的pollyfill

运行方法

npm i #安装相关依赖包
npm run build #构建dx-sdk.js

npm run dev 可以打开一个简单的测试页面

接口

  • 获取定位
dx.getLocation({
  coorType: 'wgs84' //坐标系,wgs84/bd09/gcj02
}).then(result=>{
  let {
    accuracy,
    altitude,
    altitudeAccuracy,
    coorType,
    heading,
    latitude,
    longitude,
    timestamp,
    velocity
  } = result
  // more code
}).catch(e=>{
  
})
  • 关闭窗口
dx.closeWindow()
  • 选择多张图片
dx.chooseImage({
  count:1,
  sourceType:'album' // album 相册,camera 相机
}).then(result=>{
  // more code
}).catch(e=>{
  
})
  • 选择文件
dx.chooseFile({
  sourceType:'netDisk' // 从网盘选择,从本地选择
}).then(result=>{
  
}).catch(e=>{
  
})
  • 扫描二维码
dx.scanQRCode().then(result=>{
  // more code
}).catch(e=>{
  
})
  • 预览图片
dx.previewImage({
  url:'aa' // 图片地址
})
  • 人员选择
dx.selectPeoples().then(result=>{
  let [{
        avatarUrl,
        nickname,
        orgId,
        userNo
      }]= result
  // more code
}).catch(e=>{
  
})

引入方法

npm 引入(推荐)

npm i -S dx-sdk

全量引入

import * as dx from 'dx-sdk' // 全量引入,es方式
const dx = require('dx-sdk') // commonjs模式
 dx.getLocation().then(res => {
   // more code       
 })

按需引入--推荐 这种引入模式会减小打包文件的体系(虽然本身提交就不大)

 import getLocation from 'dx-sdk/dist/lib/getLocation' // es方式引入
 const getLocation = require('dx-sdk/dist/lib/getLocation') // commonjs模式引入
 
 getLocation().then(res => {
 
 })

script引入(不推荐)

首先需要构建项目。运行npm run build 会在目录下生成dist/dx-sdk.js 即可在项目中引入该js

<html>
<script src="dist/dx-sdk.js"></script>
<script>
    dx.getLocation().then(rsp=>{
      // more code
    })
</script>
</html>