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

@jovijovi/pedro.js

v1.2.2

Published

Pedro.js is a microservice toolkit written in TypeScript

Downloads

66

Readme

Pedro.js

npm GitHub Actions Coverage FOSSA Status

https://github.com/jovijovi/pedro.js

Pedro.js is a microservice toolkit written in TypeScript.

Philosophy

Go home early from work, spend more time with family and friends, enjoy your life.

Features

  • HTTP/HTTPS 1.1

    • Based on express

    • Task Handler

      • API authorization based on 2FA

      • Health check

        Get health and version info

      • Metrics check

        Get simple metrics info

      • RequestId

  • JSON-RPC

  • WebSocket

    • Heartbeat

      Based on ws

  • Cache

  • Message Queue

    • AWS SQS
  • Database Helper

    • Dgraph

      • HTTP client helper
    • LevelDB

    • MongoDB

    • MySQL

    • PostgreSQL

    • Redis

    • SQLite

  • Logger

    • Asynchronous logging

    • Advanced logger

  • Certificate

  • Configuration

    • Custom config items
  • Security Suite

    • Crypto

      • Sign/Verify message by ECDSA

      • Encrypt/Decrypt message by AES

      • Get the digest by specified hash function

      • Get fingerprint by specified algorithm

      • Generate random salt

      • Encrypt/Verify password by pbkdf2

  • System

    • System signals handler
  • Utilities

    • Converter

      • Stream to Buffer

      • Stream to String

    • File

      • Read dedupe line from file to map
    • NanoID

    • Queue

      • A queue (FIFO), not async safe
    • Random

      • Random int
      • Random boolean
      • Random case
      • Random seed
    • Retry

      • Retry running the function m times with n seconds interval
    • Stack

      • A stack (LIFO), not async safe
    • Time

    • UUID

  • Simple Event

    • Sign/Verify signature

    • Marshal/Unmarshal

  • Expend Types

  • FSM

    • Simple FSM (sync)
  • Object Storage

    • S3 Client helper
  • Auditor

    • Simple assert
  • Tracing

  • Context

    • Context chain (parent/child)
  • Options

    • An easy-to-use options
  • IPFS

Development

Env

Node version manager nvm will helpful.

  • node v18.12.1
  • yarn v1.22.19
  • ts-node v10.9.1
  • typescript 4.9.3

Quick Guide

  • Install dependency

    yarn
  • Build

    yarn build
  • Run

    yarn dist-run --config ./conf/app.config.yaml
  • Clean

    yarn clean

Makefile

  • Build
make build
  • Make docker images
make docker

UnitTest with ts-jest

Install ts-jest

  • Step 1: install packages
yarn add --dev jest typescript ts-jest @types/jest
  • Step 2: Init ts-jest config
yarn ts-jest config:init
  • Step 3: Config package.json

Add below to package.json

  "scripts": {
    "test": "jest"
  },
  • Step 4: Run test
yarn test
  • Step 5: You will get response like this
yarn run v1.22.18
$ jest
 PASS  test/common/common.log.test.ts
  ● Console

    console.log
      logger closed

      at test/common/common.log.test.ts:39:11

......

Test Suites: 39 passed, 39 total
Tests:       104 passed, 104 total
Snapshots:   0 total
Time:        25.455 s, estimated 30 s
Ran all test suites.
Done in 26.21s.

Roadmap

  • Documents

  • Task Handler

    • Support CORS by config

    • Real remote IP

  • WebSocket

  • GRPC

  • TLS

    • Mutual TLS
  • Message Queue

    • RabbitMQ

    • Aliyun MNS

    • NSQ

  • Database Helper

    • Elasticsearch
  • Certificate

  • Service Discovery

  • Security Suite

    • Crypto

      • Encrypt/Decrypt message by RSA

      • Encrypt/Decrypt message by SM4

    • Simple dongle

    • Desensitization

      • Desensitize by rules
  • Utilities

    • Execute command

    • Path

    • Smart String

  • Job Scheduler

    • Workflow-based job scheduler

    • Storage adapter

  • Distributed Lock

    • etcd
  • Object Storage

    • OSS Helper

    • S3 Helper

Contributors

jovijovi

License

MIT

FOSSA Status