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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@paigesfirstmicroservice/common

v3.0.2

Published

- on npm website

Downloads

7

Readme

Create your organization

  • on npm website

Create a new npm package

mkdir common
cd common 
npm init --yes 

package.json

  "name": "@paigesfirstmicroservice/common",
{
  "name": "@paigesfirstmicroservice/common",
  "version": "1.0.13",
  "description": "",
  "main": "./build/index.js",
  "types": "./build/index.d.ts",
  "files": [
    "build/**/*"
  ],
  "scripts": {
    "clean": "del ./build/*",
    "build": "npm run clean && tsc",
    "pub": "git add . && git commit -m \"Updates\" && npm version patch && npm run build && npm publish"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "del-cli": "^4.0.0",
    "typescript": "^4.3.2"
  }
}

publish source code

npm login 
git add .
git commit -m "message"
npm publish --access public

Resolving Typescript Issue

Issues

  • There might be differences in out TS settings between the common lib and our services - don't want to deal with that
  • Services might not be written with TS at all!
  • Our common library will be written as Typescript and published as Javascript

on module

tsc --init 
npm install typescript del-cli --save-dev 

create typescript file

mkdir src
cd src
touch index.ts

tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "declaration": true,
    "outDir": "./build",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  }
}
tsc

.gitignore

build
node_modules

update only version

npm version patch

with our custom command

git add .
git commit -m "blabla"
# npm run build
# npm publish
npm pub 

Relocating Shared Code

index.ts

export * from "./errors/bad-request-error";
export * from "./errors/custom-error";
export * from "./errors/database-connection-error";
export * from "./errors/not-authorized-error";
export * from "./errors/not-found-error";
export * from "./errors/request-validation-error";

export * from "./middlewares/current-user";
export * from "./middlewares/error-handler";
export * from "./middlewares/require-auth";
export * from "./middlewares/validate-request";

get necessary dependencies

{
  "name": "@paigesfirstmicroservice/common",
  "version": "1.0.15",
  "description": "",
  "main": "./build/index.js",
  "types": "./build/index.d.ts",
  "files": [
    "build/**/*"
  ],
  "scripts": {
    "clean": "del ./build/*",
    "build": "npm run clean && tsc",
    "pub": "git add . && git commit -m \"Updates\" && npm version patch && npm run build && npm publish"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "del-cli": "^4.0.1",
    "typescript": "^4.3.5"
  },
  "dependencies": {
    "@types/cookie-session": "^2.0.43",
    "@types/express": "^4.17.13",
    "@types/jsonwebtoken": "^8.5.5",
    "cookie-session": "^1.4.0",
    "express": "^4.17.1",
    "express-validator": "^6.12.1",
    "jsonwebtoken": "^8.5.1"
  }
}

Import our common modules

npm install @paigesfirstmicroservice/common
import { errorHandler, NotFoundError } from "@paigesfirstmicroservice/common";

Updating Common Modules

npm update @paigesfirstmicroservice/common