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

womenperiod

v1.0.12

Published

Predict Women Problem (Menstruation Period). - Continues period. - With JavaScript, not really precious, but some relatable. - Im men, so idk what im done yet, i write for my purpose only (helping for my friends, to do for their job).

Downloads

6

Readme

Predict Women Problem (Menstruation Period)

  • Continues period.
  • With JavaScript, not really precious, but some relatable.
  • Im men, so idk what im done yet, i write for my purpose only (helping for my friends, to do for their job).
// nodejs only, if you are using bun.sh, check on file test.js
import { 
  predictWomenProblemNext, 
  createCalendarNextDataWP 
} from "womenperiod";

let predict = predictWomenProblemNext(
  '01',   //     day (begin of menstruation) 
  '01',   //   month (begin of menstruation)
  '2023', //    year (begin of menstruation)
  '5',    //  period (range of intermediate)
  '30',   //   range (range of menstruation)
  '4'     // preNext (range of next problem)
);

let b = predict.next();
let womenProblem = b.value;
console.log(womenProblem);

// output:

// {
//   menstrStart: {
//     day: 1,
//     month: 1,
//     year: 2023,
//     toString: [Function]
//   },
//   menstrEnd: {
//     day: 5,
//     month: 1,
//     year: 2023,
//     toString: [Function]
//   },
//   preProblem: {
//     day: 12,
//     month: 1,
//     year: 2023,
//     toString: [Function]
//   },
//   problemPoint: {
//     day: 15,
//     month: 1,
//     year: 2023,
//     toString: [Function]
//   },
//   postProblem: {
//     day: 18,
//     month: 1,
//     year: 2023,
//     toString: [Function]
//   },
//   preMenstr: {
//     day: 27,
//     month: 1,
//     year: 2023,
//     toString: [Function]
//   },
//   menstrRange: 30
// }

// features for React users
// suitable for Calendar, CalendarStrip Element
let calendarNextDataWP = createCalendarNextDataWP(
  '01',   //     day (begin of menstruation) 
  '01',   //   month (begin of menstruation)
  '2023', //    year (begin of menstruation)
  '5',    //  period (range of intermediate)
  '30',   //   range (range of menstruation)
  '4',    // preNext (range of next problem)
  {
    customResult: (date, k) => { // optional

      const colors = [
        '#3B3B3B', // menstrStart menstrEnd
        '#FF46B4', // preProblem postProblem
        '#00FF15', // problemPoint
        '#C566EE'  // preMenstr
      ];
  
      return {
        [date]: {
          color: colors[k]
        }
      };
    }
  }
);

console.log(calendarNextDataWP.next());

// output:

// {
//   value: [
//     {
//       "2023-01-01": {
//         color: "#3B3B3B"
//       }
//     }, {
//       "2023-01-02": {
//         color: "#3B3B3B"
//       }
//     }, ...
//   ],
//   done: false
// }

// make it easy with limitations
let max = 5;
for (let cwp of calendarNextDataWP) {

  if (!max) break;

  console.log(cwp);
  max = max - 1;
}

// output:

// [
//   {
//     "2023-02-11": {
//       color: "#FF46B4"
//     }
//   }, {
//     "2023-02-12": {
//       color: "#FF46B4"
//     }
//   }, ...
// ]
// [
//   {
//     "2023-03-02": {
//       color: "#3B3B3B"
//     }
//   }, {
//     "2023-03-03": {
//       color: "#3B3B3B"
//     }
//   }, ...
// ]
// [
//   {
//     "2023-04-01": {
//       color: "#3B3B3B"
//     }
//   }, {
//     "2023-04-02": {
//       color: "#3B3B3B"
//     }
//   }, ...
// ]
// [
//   {
//     "2023-05-01": {
//       color: "#3B3B3B"
//     }
//   }, {
//     "2023-05-02": {
//       color: "#3B3B3B"
//     }
//   }, ...
// ]
// [
//   {
//     "2023-06-11": {
//       color: "#FF46B4"
//     }
//   }, {
//     "2023-06-12": {
//       color: "#FF46B4"
//     }
//   }, ...
// ]

if you feel helped, don't forget about my coffee.

paypal.me