Giter Site home page Giter Site logo

maxim-mazurok / ez-vcard Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 171 KB

vCard generator written in TypeScript for NodeJS that uses amazing ez-vcard library written in Java

JavaScript 0.01% TypeScript 99.99%
vcard vcf nodejs typescript ezvcard ez-vcard-library vcard-generator help-wanted

ez-vcard's Introduction

ez-vcard

npm

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 make and g++ on Ubuntu: sudo apt install build-essential (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

npm install @types/node 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: npx ts-node src/vcard.ts or compile: npx tsc --outDir dist.

Note: the first run might take a while, because it downloads maven packages required for package to run. Subsequent runs will be much faster than the first one.

Features

ez-vcard's People

Contributors

maxim-mazurok avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

ez-vcard's Issues

Publish to NPM

During experiments, I published and then unpublished ez-vcard. Now I have to wait for 24 hours.
I published it at around 3-8 pm 28/09.

Figure out minimal required tsconfig.json

What is the minimal required tsconfig.json?

I got this working with the following config:

{
    "extends": "./node_modules/gts/tsconfig-google.json",
    "compilerOptions": {
        "esModuleInterop": true,
        "rootDir": "src",
        "outDir": "dist",
        "lib": [
            "es6"
        ],
        "listEmittedFiles": true,
        "typeRoots": [
            "./node_modules/@types"
        ]
    },
    "include": [
        "./src/**/*.ts"
    ]
}

which requires npm install gts.

And the project has the following structure:

- project
  - src
    - contact_picture.jpg
    - usage.ts (from https://github.com/Maxim-Mazurok/ez-vcard/blob/master/example/usage.ts)
  - package.json
  - tsconfig.json

Please, provide a better example of usage.

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.