enesser / vCards-js

Create vCards to import contacts into Outlook, iOS, Mac OS, and Android devices from your website or application.
MIT License
430 stars 158 forks source link

Using in Angular (Typescript) #48

Open anuj9196 opened 4 years ago

anuj9196 commented 4 years ago

I'm trying to use the library in the Angular 8 application. For that I installed the package using npm and in the component file, I used

import * as vCardsJS from 'vcards-js';

myMethod() {
  const vCard = vCardsJS();
  ...
}

But this gives error message as

ERROR in ./node_modules/vcards-js/index.js
Module not found: Error: Can't resolve 'fs' in '/home/code/node_modules/vcards-js'
enesser commented 4 years ago

fs the Node file system as this package was initially intended to be used server-side. On the browser, you won't have this package. There are some users who have branched this repo for use in the browser, however.

Let me know if you still need help with this.

Thanks!

alexandrosk commented 2 years ago

@enesser Hello! Do you happen to know which Fork could that be I want also to use this on nextjs, it could be done just by not having the fs functions though pretty easiliy

maxbauer commented 2 years ago

You can use this package ngx-vcard.