0.1.2 • Published 4 years ago

ez-vcard-2 v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

ez-vcard

It is a vCard generator written in TypeScript for NodeJS that uses amazing ez-vcard library written in Java. It can read and write vCards in many different formats. The "ez" stands for "easy" because the goal is to create a library that's easy to use.

Getting started

  1. Install JDK
  2. Install g++ on Ubuntu: sudo apt install g++ (to build node-java dependency)
  3. Install ez-vcard (this package) npm i ez-vcard

Usage in NodeJS

const ezVcard = require('ez-vcard').default;
(async () => {
  const vcard = await ezVcard({name: {first: 'Maxim'}});
  console.log(vcard);
})();

Usage in TypeScript

src/vcard.ts

import ezVcard from 'ez-vcard';

(async () => {
  const vcard = await ezVcard({name: {first: 'Maxim'}});
  console.log(vcard);
})();

tsconfig.json

{
  "compilerOptions": {
    "esModuleInterop": true
  }
}

and run: ts-node src/vcard.ts or compile: tsc.

Features

0.1.2

4 years ago