Create a vCard from an object. Simple wrapper around vcards-js.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
flow-typed/npm
src
.babelrc
.flowconfig
.gitignore
.npmignore
.prettierrc
.travis.yml
LICENSE.md
README.md
package.json
yarn.lock

README.md

create-vcard

Create a vCard from an object. Simple wrapper around vcards-js.

Installation

npm i create-vcard

Usage

import createVCard from 'create-vcard';

const card = createVCard({
  firstName: 'Max',
  lastName: 'Stoiber'
});

console.log(card.getFormattedString());

This will log the following:

BEGIN:VCARD
VERSION:3.0
FN;CHARSET=UTF-8:Max Stoiber
N;CHARSET=UTF-8:Stoiber;Max;;;
REV=2017-10-28T15:26:54+02:00
END:VCARD

Valid properties

See src/index.js for a list of all the valid properties.

Methods

See vcards-js for documentation of how to use the returned vCard. (this module returns a vcards-js instance)

The most useful method is card.getFormattedString() as shown above.

License

Licensed under the MIT License, Copyright ©️ 2017 Maximilian Stoiber. See LICENSE.md for more information.