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

thingyan

v0.1.1

Published

Calculates the dates and times for the Mahar Thingyan(New Year) festival based on the given Myanmar year

Downloads

5

Readme

thingyan

codecov JSR Score


About

The Myanmar new year festival (the water festival) is called the Thingyan.

This package focus on calculate information of thingyan festival days and times , that can be use in morden javascript runtimes.The function named thingyan , that generate the following from a Myanmar(Burmese) year.

  1. AkyaDayTime: string;
  2. AkyatDay: string;
  3. AkyatDay2: string;
  4. AkyoDay: string;
  5. AtatDayTime: string;
  6. NewYearDay: string;
  7. YearFrom: number;
  8. YearTo: number;

Live Thingyan Calculator : https://phothinmg.github.io/thingyan/

API Docs : https://phothinmg.github.io/thingyan/api/


Install and Usage

Browser

Import function thingyan from:

esm.run

<script type="module">
  import { thingyan } from "https://esm.run/thingyan";
  const my = 1386; // Myanmar Year
  console.log(thingyan(my));
</script>

esm.sh

<script type="module">
  import { thingyan } from "https://esm.sh/[email protected]";
  const my = 1386; // Myanmar Year
  console.log(thingyan(my));
</script>

Node ( npm registry )

npm i thingyan
yarn  add thingyan
pnpm i thingyan
import { type ThinGyan,  thingyan } from "thingyan";
const my: number = 1386; // Myanmar Year
const tg: ThinGyan = thingyan(my);

// Rest of code

Node ( jsr registry )

Before that read first Using JSR with Node.js.

npx jsr add @ptm/thingyan
yarn dlx jsr add @ptm/thingyan
pnpm dlx jsr add @ptm/thingyan
import * as mod from "@ptm/thingyan";
//OR
import { thingyan } from "@ptm/thingyan";
import { type ThinGyan } from "@ptm/thingyan";

const my: number = 1386; // Myanmar Year
const tg: ThinGyan = thingyan(my);

// Rest of code

API docs on jsr registry.

Deno ( jsr registry)

update deno to latest version to active add

deno add @ptm/thingyan

That will automatically be add @ptm/thingyan to deno.json.

{
  "imports": {
    "@ptm/thingyan": "jsr:@ptm/thingyan@^0.1.0",
    "std/": "https://deno.land/[email protected]/"
  }
}

index.ts

import { type ThinGyan, thingyan } from "@ptm/thingyan";
const my = 1386; // Myanmar Year
const tg: ThinGyan = thingyan(my);
Deno.serve((_req: Request) => {
  const response = JSON.stringify(tg);

  return new Response(response, {
    status: 200,
    headers: new Headers({ "Content-Type": "application/json" }),
  });
});
deno run --allow-read --allow-net index.ts
  • http://localhost:8000/

Bun ( jsr registry)

bunx jsr add @ptm/thingyan

That will be add install scopes for JSR to bunfig.toml.

[install.scopes]
"@jsr" = "https://npm.jsr.io"

That will automatically be create package.json and add @ptm/thingyan.

{ "dependencies": { "@ptm/thingyan": "npm:@jsr/ptm__thingyan" } }

http.ts

import { type ThinGyan, thingyan } from "@ptm/thingyan";
const my = 1386; // Myanmar Year
const tg: ThinGyan = thingyan(my);

Bun.serve({
  port: 3000,
  fetch() {
    return new Response(JSON.stringify(tg, null, 2), {
      headers: {
        "Content-Type": "application/json",
      },
    });
  },
});
 bun --hot run http.ts
  • http://localhost:3000/

Cloudflare Workers ( npm registry )

yarn add thingyan

worker.ts

import { type ThinGyan, thingyan } from 'thingyan';
const my: number = 1386; // Myanmar Year
const tg: ThinGyan = thingyan(my);

export interface Env{

}

export default {
	async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
		return new Response(JSON.stringify(tg, null, 2), {
			headers: {
				'Content-Type': 'application/json',
			},
		});
	},
};

Acknowledgement

The algorithm and calculations of this package are base on Modern Myanmar Calendrical Calculations by Yan Naing Aye.