vCards-js icon indicating copy to clipboard operation
vCards-js copied to clipboard

Using in Angular (Typescript)

Open anuj9196 opened this issue 5 years ago • 3 comments

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'

anuj9196 avatar Jan 29 '20 09:01 anuj9196

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!

enesser avatar Feb 18 '20 20:02 enesser

@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

alexandrosk avatar Dec 18 '21 16:12 alexandrosk

You can use this package ngx-vcard.

maxbauer avatar Apr 29 '22 12:04 maxbauer