New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

contacts-parser

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contacts-parser

Parser for outlook or google contact list (CSV)

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17
increased by1600%
Maintainers
1
Weekly downloads
 
Created
Source

Contact List Parser

This is a parser for Outlook or Google contact lists exported as CSV files.

Installation

To use this parser in your project, you can install it via npm:

npm install contacts-parser

Usage

import { parseContacts } from "contacts-parser";

...

export const editContacts = async (
  req: Request,
  res: Response,
) => {
  try {
    const files: any = req?.files //using Multer as request middleware
    if (isNullOrEmpty(files) || isNullOrEmpty(files['contacts'])) {
      res.sendStatus(400)
      return;
    }

    const file = files['contacts'][0];
    parseContacts(file.buffer, '54')
      .then((outputFile) => {
        const base64 = Buffer.from(outputFile).toString('base64');
        res.status(200).json({ data: base64 });
      })
      .catch((error) => {
        res.status(500).send({ error: error?.message });
      });
  } catch (err: any) {
    logger.fatal(`parseContacts error: ${err}`)
    throw err;
  }
};  

Testing

This package uses the UVU testing framework. To run the tests, use the following command:

npm test

Contributing

If you find a bug or want to contribute to the code or documentation, you can fork the repository and make changes for a later review and possible project integration.

License

This project is licensed under MIT.

Keywords

FAQs

Package last updated on 20 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc