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

@streetjs/dating-profiles

v1.0.0

Published

Official Street Framework reference package: dating profiles, likes, and reciprocal matching with encrypted bios.

Readme

@streetjs/dating-profiles

Official StreetJS Framework reference package for dating profiles, likes, and reciprocal matching (Phase 10, R11.2).

It composes hardened @streetjs/core primitives instead of reinventing them: profile bio values are encrypted at rest with the core FieldCipher/EncryptedField field-level encryption (Phase 5, R6), and a match is recorded the moment two users have liked each other.

Install

npm install @streetjs/dating-profiles streetjs

Usage

import { randomBytes } from 'node:crypto';
import { FieldCipher, Keyring } from 'streetjs';
import { ProfileService } from '@streetjs/dating-profiles';

// A versioned keyring backs envelope encryption; rotate by adding versions.
const cipher = new FieldCipher(Keyring.fromKey(randomBytes(32)));
const profiles = new ProfileService({ cipher });

// Create profiles — `bio` is stored as ciphertext, never plaintext.
await profiles.create({ userId: 'ada', displayName: 'Ada', bio: 'loves hiking' });
await profiles.create({ userId: 'lin', displayName: 'Lin', bio: 'enjoys jazz' });

await profiles.like('ada', 'lin'); // { matched: false } — one-sided
await profiles.like('lin', 'ada'); // { matched: true }  — reciprocal → match

await profiles.isMatch('ada', 'lin'); // true (order independent)
await profiles.readBio('ada');        // 'loves hiking' (authorized decrypt)

API

new ProfileService(options)

| Option | Required | Description | | -------- | -------- | ------------------------------------------------------------------ | | cipher | yes | A core FieldCipher used to encrypt each profile bio at rest. | | store | no | A ProfileStore. Defaults to InMemoryProfileStore. | | now | no | Clock injection for deterministic match timestamps (tests). |

| Method | Description | | ------------------------------ | ---------------------------------------------------------------------- | | create({ userId, displayName, bio }) | Create a profile; bio is stored encrypted. Rejects duplicates. | | getProfile(userId) | Read the stored profile (with the encrypted bio). | | readBio(userId) | Decrypt and return the plaintext bio (authorized read). | | like(from, to) | Record a directional like; returns { matched } (true on reciprocal). | | isMatch(a, b) | Whether two users are mutually matched (order independent). | | matches(userId) | All matches involving userId. |

Encrypted bios

Profile.bio is an EncryptedField<string>: the plaintext is never stored. Use readBio() (which calls the core FieldCipher.decrypt) for authorized reads.

Pluggable storage

ProfileService persists through the ProfileStore interface. The bundled InMemoryProfileStore suits tests and single-instance use; supply your own store for shared, multi-instance deployments.

Matching semantics

  • like(from, to) is directional and idempotent.
  • A Match is recorded exactly once when the second (reciprocal) like arrives — like returns { matched: true } and isMatch becomes true.
  • isMatch(a, b) is order independent: isMatch(a, b) === isMatch(b, a).
  • Self-likes are rejected and never produce a match.

Example

A runnable example lives in examples/:

node examples/index.mjs

Testing

npm test

Unit tests cover encrypted-bio storage and matching edge cases; the property-based test (*-pbt.test.ts) verifies that reciprocal likes always produce a match across arbitrary user sets (Property 24, R11.2).

License

MIT