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

nepal-sambat

v2.1.7

Published

A Vue 3 component for Nepal Sambat calendar conversion

Readme

Nepal Sambat Calendar for Vue 3

Note: This project is currently in the testing phase. Contributions, feedback, and suggestions are warmly welcomed to enhance its functionality and user experience.

The date conversion and astronomical calculations in this component are heavily based on the methodologies outlined in https://nsapi.spiralogics.net/nsalgorithm.pdf.

A Vue 3 component for displaying and converting dates to the Nepal Sambat calendar system. This package provides both a Vue component for easy integration and utility functions for date conversion.

Features

  • Convert Gregorian dates to Nepal Sambat calendar
  • Display NS year, month, and tithi
  • Show astronomical data (solar and lunar longitudes)
  • Fully typed with TypeScript
  • Vue 3 compatible
  • Responsive design
  • Comprehensive test coverage
  • CI/CD pipeline with GitHub Actions

Installation

# Using npm
npm install nepal-sambat

Usage

Basic Usage

<template>
  <NepalSambatCalendar />
</template>

<script setup>
import { NepalSambatCalendar } from 'nepal-sambat'
</script>

With Custom Date

<template>
  <NepalSambatCalendar :date="customDate" />
</template>

<script setup>
import { ref } from 'vue'
import { NepalSambatCalendar } from 'nepal-sambat'

const customDate = ref(new Date(2024, 3, 14))
</script>

Using Conversion Functions

import {
  convertToNSDate,
  convertToNSYear,
  convertToNSMonth,
  convertToTithi,
  formatNSDate,
} from 'nepal-sambat'

// Example 1: Convert current date
const today = new Date()
const date = convertToNSDate(today.getFullYear(), today.getMonth() + 1, today.getDate())
console.log(formatNSDate(date))

// Example 2: Get individual components for a date
const year = convertToNSYear(2024)
const month = convertToNSMonth(2024, 4, 14)
const tithi = convertToTithi(2024, 4, 14)
console.log(`Year: ${year}, Month: ${month.nepaliName}, Tithi: ${tithi.name}`)

// Example 3: Convert a custom date
const customDate = new Date(2024, 3, 14)
const customNSDate = convertToNSDate(
  customDate.getFullYear(),
  customDate.getMonth() + 1,
  customDate.getDate(),
)
console.log(formatNSDate(customNSDate))

// Example 4: Convert a date directly with year, month, day
const date2 = convertToNSDate(2024, 3, 14)
console.log(formatNSDate(date2))

// Example output format:
// {
//   nsYear: 1144,
//   month: {
//     number: 12,
//     name: 'Yanlā',
//     nepaliName: 'ञंला',
//     startDeg: 150
//   },
//   tithi: {
//     number: 4,
//     adjustedNumber: 4,
//     paksha: 'थ्व',
//     name: 'चतुर्थी'
//   },
//   astronomical: {
//     solarLongitude: 353.45,
//     lunarLongitude: 45.67,
//     elongation: 52.22
//   },
//   julianDay: 2460384.5
// }

Props

| Prop | Type | Default | Description | | ---- | ---- | ---------- | ------------------------------ | | date | Date | new Date() | Date to convert to NS calendar |

Technical Details

The package uses advanced astronomical calculations to ensure accurate date conversions:

  • Solar and lunar longitude calculations
  • Julian Day Number conversions
  • Astronomical corrections for improved accuracy
  • TypeScript for type safety and better developer experience
  • Vue 3 compatibility for seamless integration

Development

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Run tests
npm test

# Run tests for conversion
npm run convert

Testing Phase

This project is currently in testing phase. We need help with:

  • Testing date conversions across different years
  • Verifying astronomical calculations
  • Performance optimization

License

MIT