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 🙏

© 2026 – Pkg Stats / Ryan Hefner

vv-schedule-parser

v0.2.0

Published

parse date & schedule from yaml

Readme

schedule-parser

구성

{ DateParser, TimeParser, ScheduleParser }

DateParser

include-dates 와 exclude-dates로 구성된 날짜 정보에 따라 동작 가능한 Date type의 구간 목록(Array<{from: Date, to: Date}>)을 반환하거나 주입받은 Date의 가능 여부를 계산한다

# yaml file

include-dates:
  - start: "2022-05-01"
    end: "2022-05-31"
  - date: "2022-07-05"
  - date: "2022-07-12"
exclude-dates:
  - start: "2022-04-25"
    end: "2022-05-10"
  - date: "2022-05-31"
  - date: "2022-06-23"
  - start: "2022-07-10"
    end: "2022-07-16"
// constructor

type DateYAML = {
    "start"?: string,
    "end"?: string,
    "date"?: string
}
type DatesYAML = Array<DateYAML>

constructor(includes: DatesYAML, excludes: DatesYAML)
const dateParser = new DateParser({"include-dates"}, {"exclude-dates"})

const dateRangeList = dateParser.dateRangeList // => [{from, to}, {from, to}, ...]

// or

dateParser.calcAvailable({"Date"}) // => (true or false)

TimeParser

include-times, exclude-times로 제공되는 시간 조건에 따라 정해진 기간 사이 동작 가능한 Date type의 구간 목록(Array<{from: Date, to: Date}>)을 반환하거나 주입받은 Date의 가능 여부를 계산한다

# yaml file

include-times:
  - start-time: "09:00"
    end-time: "18:00"
exclude-times:
  - start-time: "12:00"
    end-time: "13:00"
  - weekdays: ["mon"]
    start-time: "17:00"
    end-time: "20:00"
// constructor

type WeekdayAndTimeYAML = {
    "start-time"?: string,
    "end-time"?: string,
    "weekdays"?: [string]
}
type WeekdayAndTimesYAML = Array<WeekdayAndTimeYAML>

constructor(includes?: WeekdayAndTimesYAML,
            excludes?: WeekdayAndTimesYAML,
            dateRange?: { from: Date, to: Date } | null,  // Date 범위 혹은
            startDate?: string, endDate?: string)         // 시작일 종료일 string 주입
const timeParser = new TimeParser({"include-times"}, {"exclude-times"}, [{"{from:, to:}"} || {"start date"}, {"end date"}])

const dateRangeList = timeParser.dateRangeList // => [{from, to}, {from, to}, ...]

// or

timeParser.calcAvailable({"Date"}) // => (true or false)

ScheduleParser

DateParser와 TimeParser를 이용하여 Date type의 구간 목록(Array<{from: Date, to: Date}>)을 반환하거나 주입받은 Date의 가능 여부를 계산한다

# yaml file

include-dates:
  - start: "2022-04-01"
    end: "2022-04-30"
exclude-dates:
  - date: "2022-04-01"
  - date: "2022-04-02"
  - date: "2022-04-03"
  - start: "2022-04-12"
    end: "2022-04-30"
include-times:
  - start-time: "09:00"
    end-time: "18:00"
exclude-times:
  - start-time: "12:00"
    end-time: "13:00"
  - weekdays: ["mon"]
    start-time: "17:00"
    end-time: "20:00"
// constructor

constructor(includeDates: DatesYAML, excludeDates: DatesYAML,
        includeTimes: WeekdayAndTimesYAML, excludeTimes: WeekdayAndTimesYAML)
const scheduleParser = new ScheduleParser({"include-dates"}, {"exclude-dates"}, {"include-times"}, {"exclude-times"})

const dateRangeList = scheduleParser.dateRangeList // => [{from, to}, {from, to}, ...]

// or

scheduleParser.calcAvailable({"Date"}) // => (true or false)

Usage

const {DateParser, TimeParser, ScheduleParser} = require('schedule-parser');