Giter Site home page Giter Site logo

cozy-vcard's Introduction

cozy-vcard

Build Status

Description

cozy-vcard is a simple library to deal with the vcard format. It makes life easier to parse vcard files.

Usage

# Import

var vcf = fs.readFileSync('test/friend.vcf', 'utf8');
var vparser = new VCardParser(vcf);
var vcontact = vparser.contacts[0];
var vsomeprop = vcontact.datapoints[0]:
// vcontact.org == 'SuperCorp'
// vsomeprop.value == '+33123456789'
// vsomeprop.name == 'tel'
// vsomeprop.type == 'home'
// vsomeprop.pref == true


# Export
var vcfString = VCardParser.toVCF(vcontact);
var vcf = fs.writeFileSync('test/friend-export.vcf', vcfString, 'utf8');

Format

This vCard importer doesn't try to follow the official RFC. It is just made to handle properly vCards from major vendors: Google, Android, iOS, OSX and thunderbird.

The vCard exporter follow the Google way to write vcards. It can take an option to export the data to Android format or iOS format

How data are handled in memory

Data are stored as direct fields when vendors provide them that way. If not they are handled as "datapoints". One data datapoint has three fields:

  • name: the category of the data
  • type: the label of the field
  • value: the value of the field

TODO

If you want to contribute, here is a non-exhaustive list of things to do to make this project perfect!

Export:

  • manage properly the pref attribute.
  • manage properly custom types (currently they are often exported uppercased).

Tests:

  • Make full tests field values totally agnostic.
  • Test all fields of full vCards during import and export.

Handle other vendors:

  • Thunderbird plugins
  • Outlook
  • FullContact

What is Cozy?

Cozy Logo

Cozy is a platform that brings all your web services in the same private space. With it, your web apps and your devices can share data easily, providing you with a new experience. You can install Cozy on your own hardware where no one profiles you. You install only the applications you want. You can build your own one too.

Community

You can reach the Cozy community via various support:

cozy-vcard's People

Contributors

aenario avatar jacquarg avatar nono avatar clochix avatar jsilvestre avatar mizrachiran avatar nehakadam avatar parro-it avatar arnoschn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.