rrule-rust
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

rrule-rust

npm version npm downloads/month npm downloads license

rrule-rust is a napi-rs wrapper around Rust's rrule crate

  1. Quick Start
  2. Perfomance

Quick Start

See test folder to find more use cases

  npm i rrule-rust 
import { RRule, RRuleSet, Frequency } from 'rrule-rust';

const rrule = new RRule(Frequency.Daily).setCount(5);
const set = new RRuleSet(873205200000, 'US/Eastern').addRrule(rrule);

const dates = set.all(); // [ 873205200000, 873291600000, 873378000000, 873464400000, 873550800000 ]
const asString = set.toString(); // DTSTART;TZID=US/Eastern:19970902T090000\nFREQ=daily;COUNT=5;BYHOUR=9;BYMINUTE=0;BYSECOND=0

Perfomance

  Host: MacBook Pro, 13-inch, 2018
  OS: macOS 13.2 (22D49)
  Processor: 2,3 GHz Quad-Core Intel Core i5
  Memory: 16 GB 2133 MHz LPDDR3
rrule rrule-rust
UTC TZ 8 128 ops/s 42 343 ops/s ~5x faster
Other TZ 68 ops/s 40 549 ops/s ~600x faster

You can run benchmarks using npm run benchmark

License

rrule-rust is MIT licensed.

Readme

Keywords

Package Sidebar

Install

npm i rrule-rust

Weekly Downloads

2,543

Version

1.2.0

License

MIT

Unpacked Size

38.5 kB

Total Files

17

Last publish

Collaborators

  • lsndr