npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

welstory-menu-pdf-parser

v1.2.0

Published

[![npm](https://img.shields.io/npm/v/welstory-menu-pdf-parser)][npm-url] [![NPM](https://img.shields.io/npm/l/welstory-menu-pdf-parser)][npm-url]

Downloads

7

Readme

웰스토리 메뉴 PDF Parser

npm NPM

삼성 웰스토리 구내식당 영양사님께서 매주 메일로 보내주시는 메뉴 PDF 파일에서 메뉴 정보를 식사, 날짜별로 구분하여 구글 캘린더 등에 등록하여 사용하기 위한 목적으로 만들어진 모듈 입니다.

현재 와디즈가 입주되어 있는 판교디지털센터(PDC) 구내식당의 매뉴를 잔디(JANDI)의 Webhook을 활용하여 알림을 발송하는데 사용되고 있습니다.

잔디 메신저 활용 이야기 - 와디즈 캐스트

그리고 welstory-menu-pdf-parserpdf2json 패키지의 의존성을 가지고 있습니다.

설치

# Yarn
yarn add welstory-menu-pdf-parser

# npm
npm install welstory-menu-pdf-parser

예제

const fs = require('fs');
const { menuPdfParser } = require('welstory-menu-pdf-parser');

const file = fs.readFileSync('/path/to/menu.pdf');
menuPdfParser(file)
  .then(data => console.log(data));

WelstoryMenuParser 인스턴스를 직접 사용하는 방법

const fs = require('fs');
const PDFParser = require('pdf2json');
const { WelstoryMenuParser } = require('welstory-menu-pdf-parser');

const pdf2Json = new PDFParser();
pdf2Json.on('pdfParser_dataReady', (data) => {
  const parser = new WelstoryMenuParser(data);

  // 기본 데이터 세트
  console.log(parser.getData());

  // 식사별로 구분되어 있는 데이터 (구글 캘린더에 등록하기 위한 용도)
  // `menuPdfParser` 함수를 사용할 때에 기본적으로 `getMeals` 함수로 호출됩니다.
  console.log(parser.getMeals());
});
pdf2Json.on('pdfParser_dataError', (error) => {
  console.error(error.parserError);
});

const file = fs.readFileSync('/path/to/menu.pdf');
pdf2Json.parseBuffer(file);