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 🙏

© 2025 – Pkg Stats / Ryan Hefner

vcfer

v1.1.1

Published

A robust, heavily typed vCard and jCard parser.

Downloads

29

Readme


This is a vcf interpreter written in typescript, based heavily on node-vcf by Jonas Hermsmeier. It's still a work in progress, including this readme file.


Installation

npm i -s vcfer
yarn add vcfer

Import

import VCard from 'vcfer'
const VCard = require('vcfer').default

Usage

const card = new VCard()

card.add('n', 'Saw;Timber;;;')
card.add('fn', 'Timber Saw')
card.add('title', 'Rizzrack, the Timbersaw')
card.add('tel', '(123) 456 7890')
card.add('tel', '(987) 654 3210', { type: ['work'] })

console.log(card.toString())
console.log(card.toJCard())
BEGIN:VCARD
VERSION:4.0
N:Saw;Timber;;;
FN:Timber Saw
TITLE:Rizzrack, the Timbersaw
TEL:(123) 456 7890
TEL;TYPE=work:(987) 654 3210
END:VCARD
[
	"vcard",
	[
		["version", {}, "text", "4.0"],
		["n", {}, "text", ["Saw", "Timber", "", "", ""]],
		["fn", {}, "text", "Timber Saw"],
		["title", {}, "text", "Rizzrack, the Timbersaw"],
		["tel", {}, "text", "(123) 456 7890"],
		["tel", { "type": ["work"] }, "text", "(987) 654 3210"]
	]
]

A card can be loaded from a file.

const card = new VCard(fs.readFileSync('timbersaw.vcf'))

Properties can be worked with directly.

import VCard, { Property } from 'vcfer'

const emailProp = new Property('email', '[email protected]')
card.set(emailProp)
console.log(card.toString())

Contributing

vCard is a complicated specification, and different providers (iOS, Android, etc.) all export their contacts in slightly different ways and with a multitude of different fields -- some of which are covered by the 8+ year old RFC specification, but many of which are not.

The goal of this library is a parser that is:

  • 100% RFC specification compliant, while also taking into account real-world patterns and properties outside of it (like X-SOCIAL-PROFILE)
  • heavily typed for a better developer experience
  • features utilities for obvious and common actions on vCard objects and properties

Libraries for complicated specs do best with more than one pair of eyes on them, so if you want to contribute, absolutely make a pull request! 🥂

Goals

  • [ ] An enum that includes all RFC specification properties, and all common (and perhaps not-so-common) X- prefix properties and others.
    • The ability to work with properties outside that enum, if necessary.
  • [ ] Methods for common property params like TYPE=pref.