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

@ldshape/contacts

v1.0.0

Published

A shape for contacts and address-book related items.

Downloads

21

Readme

@ldshape/contacts

A shape for contacts and address-book related items.

This project includes shapes and generated files for LDO.

Installation

npm i @ldshape/contacts

contacts

Usage with LDO

import { createLdoDataset } from "@ldo/ldo";
import { AddressBookShapeShapeType, AddressBookIndividualShapeShapeType, AddressBookEmailShapeShapeType, AddressBookTelephoneShapeShapeType, AddressBookWebPageShapeShapeType, AddressBookNameShapeShapeType, AddressBookAddressShapeShapeType, AddressBookGroupShapeShapeType } from "@ldshape/contacts";
import type { AddressBookShape, AddressBookIndividualShape, AddressBookEmailShape, AddressBookTelephoneShape, AddressBookWebPageShape, AddressBookNameShape, AddressBookAddressShape, AddressBookGroupShape } from "@ldshape/contacts";
const ldoDataset = createLdoDataset();

const example0: AddressBookShape = ldoDataset
  .usingType(AddressBookShapeShapeType)
  .fromSubject("http://example.com/example0");

const example1: AddressBookIndividualShape = ldoDataset
  .usingType(AddressBookIndividualShapeShapeType)
  .fromSubject("http://example.com/example1");

const example2: AddressBookEmailShape = ldoDataset
  .usingType(AddressBookEmailShapeShapeType)
  .fromSubject("http://example.com/example2");

const example3: AddressBookTelephoneShape = ldoDataset
  .usingType(AddressBookTelephoneShapeShapeType)
  .fromSubject("http://example.com/example3");

const example4: AddressBookWebPageShape = ldoDataset
  .usingType(AddressBookWebPageShapeShapeType)
  .fromSubject("http://example.com/example4");

const example5: AddressBookNameShape = ldoDataset
  .usingType(AddressBookNameShapeShapeType)
  .fromSubject("http://example.com/example5");

const example6: AddressBookAddressShape = ldoDataset
  .usingType(AddressBookAddressShapeShapeType)
  .fromSubject("http://example.com/example6");

const example7: AddressBookGroupShape = ldoDataset
  .usingType(AddressBookGroupShapeShapeType)
  .fromSubject("http://example.com/example7");

ShEx Typings

# Taken and modified from https://github.com/solid/contacts/blob/main/shapes/contacts-shapes.ttl

PREFIX srs: <https://shaperepo.com/schemas/chat#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>

srs:AddressBookShape EXTRA a {
  a [ vcard:AddressBook ] ;
  dc:title xsd:string +;
  vcard:nameEmailIndex xsd:string +;
  vcard:groupIndex IRI ;
  vcard:includesGroup @srs:AddressBookGroupShape *;
  vcard:inAddressBook @srs:AddressBookIndividualShape *;
}

srs:AddressBookIndividualShape EXTRA a {
  a [ vcard:Individual ] ;
  vcard:fn xsd:string +;
  vcard:hasUID IRI ?;
  vcard:hasName @srs:AddressBookNameShape ?;
  vcard:hasPhoto IRI *;
  vcard:hasRelated IRI *;
  vcard:url (IRI OR @srs:AddressBookWebPageShape) *;
  vcard:hasAddress @srs:AddressBookAddressShape *;
  vcard:bday xsd:dateTime ?;
  vcard:anniversary xsd:dateTime ?;
  vcard:hasEmail @srs:AddressBookEmailShape ?;
  vcard:hasTelephone @srs:AddressBookTelephoneShape ?;
  vcard:organization-name xsd:string ?;
  vcard:role xsd:string ?;
  vcard:title xsd:string ?;
  vcard:note xsd:string ?;
  owl:sameAs @srs:AddressBookIndividualShape *;
}

srs:AddressBookEmailShape EXTRA a {
  a [ vcard:Email ];
  vcard:value IRI /^mailto:/ ;
}

srs:AddressBookTelephoneShape EXTRA a {
  a [ vcard:Tel ] ;
  vcard:value IRI /^tel:/ ;
}

srs:AddressBookWebPageShape EXTRA a {
  a [ vcard:WebID ];
  vcard:value IRI /^https?:/ ;
}

srs:AddressBookNameShape EXTRA a {
  vcard:given-name xsd:string ?;
  vcard:family-name xsd:string ?;
  vcard:additional-name xsd:string ?;
  vcard:honorific-prefix xsd:string ?;
  vcard:honorific-suffix xsd:string ?;
}

srs:AddressBookAddressShape EXTRA a {
  vcard:street-address xsd:string ;
  vcard:locality xsd:string ;
  vcard:postal-code xsd:string ;
  vcard:country-name xsd:string ;
}

srs:AddressBookGroupShape EXTRA a {
  a [ vcard:Group ] ;
  vcard:fn xsd:string *;
  vcard:member @srs:AddressBookIndividualShape *;
}

TypeScript Typings

import { ContextDefinition } from "jsonld";

/**
 * =============================================================================
 * Typescript Typings for contacts
 * =============================================================================
 */

/**
 * AddressBookShape Type
 */
export interface AddressBookShape {
  "@id"?: string;
  "@context"?: ContextDefinition;
  type: {
    "@id": "AddressBook";
  };
  title: string[];
  nameEmailIndex: string[];
  groupIndex: {
    "@id": string;
  };
  includesGroup?: AddressBookGroupShape[];
  inAddressBook?: AddressBookIndividualShape[];
}

/**
 * AddressBookIndividualShape Type
 */
export interface AddressBookIndividualShape {
  "@id"?: string;
  "@context"?: ContextDefinition;
  type: {
    "@id": "Individual";
  };
  fn: string[];
  hasUID?: {
    "@id": string;
  };
  hasName?: AddressBookNameShape;
  hasPhoto?: {
    "@id": string;
  }[];
  hasRelated?: {
    "@id": string;
  }[];
  url?: (
    | {
        "@id": string;
      }
    | AddressBookWebPageShape
  )[];
  hasAddress?: AddressBookAddressShape[];
  bday?: string;
  anniversary?: string;
  hasEmail?: AddressBookEmailShape;
  hasTelephone?: AddressBookTelephoneShape;
  organizationName?: string;
  role?: string;
  title?: string;
  note?: string;
  sameAs?: AddressBookIndividualShape[];
}

/**
 * AddressBookEmailShape Type
 */
export interface AddressBookEmailShape {
  "@id"?: string;
  "@context"?: ContextDefinition;
  type: {
    "@id": "Email";
  };
  value: {
    "@id": string;
  };
}

/**
 * AddressBookTelephoneShape Type
 */
export interface AddressBookTelephoneShape {
  "@id"?: string;
  "@context"?: ContextDefinition;
  type: {
    "@id": "Tel";
  };
  value: {
    "@id": string;
  };
}

/**
 * AddressBookWebPageShape Type
 */
export interface AddressBookWebPageShape {
  "@id"?: string;
  "@context"?: ContextDefinition;
  type: {
    "@id": "WebID";
  };
  value: {
    "@id": string;
  };
}

/**
 * AddressBookNameShape Type
 */
export interface AddressBookNameShape {
  "@id"?: string;
  "@context"?: ContextDefinition;
  givenName?: string;
  familyName?: string;
  additionalName?: string;
  honorificPrefix?: string;
  honorificSuffix?: string;
}

/**
 * AddressBookAddressShape Type
 */
export interface AddressBookAddressShape {
  "@id"?: string;
  "@context"?: ContextDefinition;
  streetAddress: string;
  locality: string;
  postalCode: string;
  countryName: string;
}

/**
 * AddressBookGroupShape Type
 */
export interface AddressBookGroupShape {
  "@id"?: string;
  "@context"?: ContextDefinition;
  type: {
    "@id": "Group";
  };
  fn?: string[];
  member?: AddressBookIndividualShape[];
}