Table of Contents

VCF

This is the documentation of the VCF module that implements vCard tools. loader.

Use require( "./example.vcf", hop.vcf )

This returns the vcard elements as a JavaScript array or arrays.

Example

Assuming the file ex.vcf

BEGIN:VCARD
VERSION:2.1
FN:Foo Joe
N:Foo;Joe;;;
TEL;CELL:11 22 33 44 55
END:VCARD
BEGIN:VCARD
VERSION:2.1
FN:Bar Mitch
N:Bar;Mitchi;;;
TEL;CELL:66 77 88 99 00
END:VCARD

The following Hop program

"use hopscript"

console.log( require( "./ex.vcf", hop.vcf ).map( o => o.familyname ) )

outputs

[ 'Foo', 'Bar' ]

Functions

vcf.load( file )

Parse a vcf file and return an return it as an JavaScript array and vCard objects.

vcf.stringify()

Convert the vCard object into a string representation that is suitable to vcf.parse.

vcf.parse()

Parse a string representation of a vCard.