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

prs-lib

v0.1.0

Published

Social Identity / Publish System based on Blockchain.

Readme

PRS Lib

是对 PRS REST API 的封装,开发者可以直接调用与 PRS 服务进行通信。

PRS 目前提供了两个环境供开发者使用:

  • 正式环境,域名是 https://press.one 。
  • 测试环境,域名是 https://dev.press.one 。

目前对 DApp 开放的接口有:

  • DApp 创建和维护。
  • 用户授权。
  • 签名。
  • 签名文件相关。(签名文件、获取文件)
  • 合约相关。(创建合约、绑定合约、查询合约)
  • 合约交易相关。(购买合约、合约交易记录)
  • 区块信息查询。
  • 钱包相关。(查询钱包、查询交易历史、充值、提现)

快速开始

注册账号

  1. 开发者前往 PRS 官网注册账号。(正式环境:https://press.one,测试环境:https://dev.press.one )
  2. 登录成功后进入开发者设置我的 DApp,完善开发者信息以及创建 DApp。
  3. 在项目中安装此 Lib .
  4. DApp 在合适的时候引导用户进行授权。
  5. 授权成功后即可进行签名发布文件、创建合约等操作。

PRS SDK 中有不同场景的使用示例,开发者可前往下载,配合 API 文档进行阅读。更多信息,请参考开发者网站

安装

通过 npm 安装:

npm install prs-lib --save

初始化

在代码中通过 require 获得 SDK 的引用,之后创建 client:

const PRS = require('prs-lib');
// 初始化 client。
const client = new PRS({
  env: 'env', debug: true, address: authAddress, token: token
  onApiError: function(err, res) {
    console.log(err, res)
    return true
  }
});

示例代码

以下代码根据块的 id 从链上对块内容进行获取

const PRS = require("prs-lib");

const client = new PRS({ env: "env", debug: true });
const res = await client.block.getByRIds([
  "ba03bd584d69b89615ce8db22b4c593342a5ec09b343a7859044a8e4d389c4c2",
  "65163724a98d29506b1031dc68fa62fb5a7a11fe631fb723a723b2a19e9bb65c"
]);
console.log(res.body);

API

prs-lib 暴露一个 PRS 类,开发者通过创建 PRS 实例,来对 REST API 进行交互。

请参考API.md