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

sdksignerbak

v1.0.1

Published

sdk 签名算法

Downloads

2

Readme


JavaScript Style Guide

京东云Node SDK

欢迎使用京东云API网关开发者Node工具套件(Nodejs Signature SDK)。使用京东云API网关Node Signature SDK,您无需复杂编程就可以访问京东云API网关API提供者提供的各种服务。 为了方便您理解SDK中的一些概念和参数的含义,使用SDK前建议您先查看京东云API网关使用入门。

安装

npm install @jdcloud/sdksigner

使用说明

  1. 安装后,引入 const {Signer,Context}=require('@jdcloud/sdksigner')
  2. 设置请求上下文Context,如host,path,method,headers,serviceName(默认为'')。具体参见构造函数,
  3. 初始化Signer,设置ak/sk和logger(默认为console),执行方法得到签名并放到header中

###例子如下:

const {Signer,Context}=require('../src')
let ctx=new Context('192.168.180.18','/v1/regions/cn-north-1/buckets','GET',null,'oss')
ctx.regionId='cn-north-1'
ctx.query=ctx.buildQuery({a:1})
ctx.headers.set('content-type','application/json')
ctx.buildNonce()

let credentials= {
    accessKeyId : '0449DD5411F3EAED92335DC5EDAFEAFF',
    secretAccessKey: '7989C15CB8705962B860A2BB5BA3FC40'
}

let signer=new Signer(ctx,credentials)
let auth= signer.sign(new Date())
ctx.headers.set('Authorization',auth)
console.log("GET签名为:",auth)

console.log('------------------------')

ctx.query=null
ctx.body=JSON.stringify({a:1,b:2})
ctx.method='POST'
signer=new Signer(ctx,credentials)
auth= signer.sign(new Date())
console.log("POST签名为:",auth)