The `vcard-parser` library is a utility for parsing vCard data into JavaScript objects and converting JavaScript objects back into vCard strings. It is designed to be a simple, standalone solution compatible with both Node.js environments and web browsers. Currently stable at version 1.0.0, the package primarily targets CommonJS module systems, as indicated by its usage examples. While it offers core vCard parsing and generation capabilities, its 'simple' nature might imply a focus on common vCard patterns rather than full support for every obscure or bleeding-edge vCard specification variant. As a 1.0.0 release, its release cadence is likely stable with infrequent updates, and its key differentiator is its straightforward, no-frills approach to vCard manipulation.
npm install vcard-parserVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to parse a raw vCard string into a JavaScript object and then convert that object back into a vCard string using the `vcard-parser` library.
Use CommonJS `require` for importing. For ESM projects, consider a dynamic `import()` or a CommonJS wrapper if absolutely necessary, or use a different vCard library with native ESM support.
Ensure input vCard strings adhere strictly to RFC 2426 (or subsequent) formatting, particularly regarding line endings and property syntax. Pre-process input strings to normalize line endings if necessary.
Thoroughly test with diverse vCard inputs, especially those leveraging newer specifications or custom fields. For full RFC compliance across all vCard versions, a more robust and actively maintained library might be required.
Ensure the library is imported using `const vCard = require('vcard-parser');` in a CommonJS environment. For ESM, this package is not directly compatible.This library is CommonJS. If you are in an ESM project, you cannot `import` it directly. You must use `require('vcard-parser')` within a CJS context or consider a different library.This error is likely related to *your project's* configuration, not `vcard-parser` itself (which is CJS). Ensure your environment is configured for ESM if you are writing ESM, or revert to CommonJS syntax if not.
No dependency data recorded yet.