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

@suman-jangili/privacy-first-server

v0.1.7

Published

A tiny Express server for the privacy‑first demo (handles key generation, encryption, etc.)

Downloads

24

Readme

📄 privacy‑first‑server

@suman-jangili/privacy‑first‑server

A minimal privacy‑first backend built with Express, TypeScript, and libsodium‑wrappers.
It provides a tiny API for generating key pairs, encrypting, and decrypting data—perfect for pairing with the companion client package (@suman-jangili/privacy‑first‑client).


Table of Contents


Installation

From npm:

npm install @suman-jangili/privacy-first-server

Or add it as a dependency in your own project

npm i @suman-jangili/privacy-first-server

To develop the server yourself, clone the repo and install dev dependencies:

git clone https://github.com/sumanjangili/privacy-first.git
cd privacy-first/server
npm ci        # installs exact versions from lockfile

Running Locally

  1. Build the TypeScript sources
    npm run build
  2. Start the server (defaults to PORT 3000)
     npm start
  3. The server will listen on http://localhost:3000. You can also use the development script for hot‑reloading:
    npm run dev

API Endpoints

Method Path Description

  • GET /health Simple health check ({ ok: true }).
  • POST /keypair Returns a freshly generated NaCl key pair (publicKey, secretKey).
  • POST /encrypt Body: { publicKey, secretKey?, message } → Returns { ciphertext, nonce }.
  • POST /decrypt Body: { publicKey, secretKey, ciphertext, nonce } → Returns { message }.
  • All payloads and responses are JSON‑encoded. Errors are returned with a 400 status and an error field describing the problem.

Scripts Overview

  • dev Runs ts-node-dev for live reload while developing.
  • build Compiles TypeScript to dist/ (tsc).
  • start Executes the compiled server (node dist/index.js).
  • gen:keypair Utility script to generate a key pair from the CLI:
     npm run gen:keypair

Building & Publishing

When you’re ready to publish a new version to npm:

  1. Bump the version (patch, minor, or major)
    npm version patch   # → e.g., 0.1.6 → 0.1.7
  2. Compile the code
    npm run build
  3. Publish (public)
    npm publish --access public

The package ships type declarations (*.d.ts) automatically, so consumers get full TypeScript support.


Contributing

We love contributions! Follow these steps:

  1. Fork the repository.
  2. Create a feature branch
     git checkout -b feat/awesome-feature
  3. Implement your change and run the test suite and lint to ensure TypeScript compiles:
     npm test && npm run lint && npm run typecheck
  4. Open a Pull Request against main. Please keep the API surface stable and add documentation for any new endpoints.

License

MIT © Suman Jangili. See the LICENSE file for full terms.


Related Projects