0.0.2 • Published 11 months ago

js.vcf v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

js.vcf

npm npm license


Introduction

This is a simple javascript lib which parses vCard file (*.vcf) and generate vcf object.

  • Only support vCard 2.1 version.
  • Only support parse, generating is not currently (or permanently) supported.

USE

Install

npm install js.vcf

parse one vCard

const fs = require('fs')
const {parseVCard} = require('js.vcf')

const vcfText = fs.readFileSync('/path/to/vcf.vcf')
var vCard = parseVCard(vcfText)
console.log(vCard.NF[0].VALUE)
console.log(vCard)
{
    VERSION:2.1,
    N:[
        {
            PROPERTY1:property,
            PROPERTY2:property,
            VALUE:value
        }
    ],
    NF:{...},
    TEL:{...},
    ...
}

parse batch of vCards

const fs = require('fs')
const {parseVCards} = require('js.vcf')

const vcfText = fs.readFileSync('/path/to/vcf.vcf')
var vCards = parseVCard(vcfText)

console.log(vCards)
[
    vCardObj,
    vCardObj,
    ...
]
0.0.2

11 months ago

0.0.1

12 months ago