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

balinese-date-js-lib

v0.4.3

Published

Library to Develop Balinese Saka Calendar (Kalender Bali)

Downloads

48

Readme

BalineseDate Javascript Library

pipeline status coverage report

Introduction

BalineseDate is an open source javascript library to build Balinese Saka Calendar in HTML-page or NodeJS.

Note: This library is in Beta Phase, the API may change without notice.

Features

BalineseDate is designed to be immutable. BalineseDate have several features like:

BalineseDate also have several utilities that can be use by developer like:

  • Filter BalineseDate(s) from selected Date (v0.2.0)
  • Filter BalineseDate(s) from selected BalineseDate List (v0.4.0)
  • List of Rahinan given the BalineseDate (v0.4.2)

Import BalineseDate into Your Project

BalineseDate Javascript Library use unpkg as repository to publish UMD Library, and also use npmjs.com as repository to publish NodeJS Library.

To import BalineseDate to your project, please choose one of these following method:

Direct Download

NPM Install

NPM

Documentation

How to Build

Requirement

The recomended requirement to build this project are:

  1. Latest NodeJS (Recomended >= 10.x)
  2. Latest Git Client

Download and Install BalineseDate Depedencies

To install NPM depedencies that nessesary to build this project, you should execute the command below:

[project root]$ npm install

Building BalineseDate Library

To build all type of BalineseDate Libraries (NodeJS library, UMD library, and production-ready UMD library), you should execute the command below:

[project root]$ npm run build

If you only need to build specific type of BalineseDate library, you can execute the commands below:

# Build NodeJS Library
[project root]$ npm run build:nodejs

# Build UMD Library
[project root]$ npm run build:umd

# Build production-ready UMD Library
[project root]$ npm run build:umd-dist

Building Documentation (Typedoc)

Documentation of BalineseDate Library can be built by executing the command below:

[project root]$ npm run doc

You can find the documentation at:

[project root]/doc/index.html

Testing & Checking

Testing and checking of BalineseDate Library can be done by executing the command below:

[project root]$ npm run test

To build test result, you should enter the command below:

[project root]$ npm run report

You could find the test results at:

[project root]/coverage/lcov-report/index.html

Using in Code

ES6/Typescript Approach

BalineseDate support Typescript by implementing declaration file *.d.ts inside the NodeJS library.

Below code is an example of how to use of BalineseDate (NodeJS version) library in Typescript *.ts file:

import { BalineseDate } from "balinese-date-js-lib";

const now = new BalineseDate();

console.log(now.saka); // show the saka
console.log(now.sasih.name); // show the sasih name
console.log(now.wuku.name); // show the wuku name

CommonJS (NodeJS) Approach

Below code is an example of how to use of BalineseDate (UMD or NodeJS version) library using CommonJS (NodeJS) approach:

const BD = require('balinese-date-js-lib');

const now = new BD.BalineseDate();

console.log(now.saka); // show the saka
console.log(now.sasih.name); // show the sasih name
console.log(now.wuku.name); // show the wuku name

RequireJS (AMD) Approach

Below code is an example of how to use of BalineseDate (UMD version) library via RequireJS (AMD):

<script src="require.js"></script>
<script src="balinese-date-js-lib.min.js"></script>
<script>
    requirejs(["BalineseDate"], function(BD) {
      var now = new BD.BalineseDate();

      document.getElementById("saka").innerHTML = now.saka;
      document.getElementById("sasih").innerHTML = now.sasih.name;
      document.getElementById("wuku").innerHTML = now.wuku.name;
    });
</script>

The example(s) of how to use UMD version of BalineseDate library via require.js in the HTML-page are available at:

[project root]/example/webpage/today-requirejs.html

HTML-page "Direct" Approach

Below code is an example of how to use of BalineseDate (UMD version) library directly in the HTML-page:

<script src="balinese-date-js-lib.min.js"></script>
<script>
    var BD = window.BalineseDate;
    var now = new BD.BalineseDate();

    document.getElementById("saka").innerHTML = now.saka;
    document.getElementById("sasih").innerHTML = now.sasih.name;
    document.getElementById("wuku").innerHTML = now.wuku.name;
</script>

The example(s) of how to use UMD version of BalineseDate library directly in the HTML-page are available at:

[project root]/example/webpage/today.html

References

  • Ardhana, I.B.S. (2005). "Pokok-Pokok Wariga". Surabaya : Paramita.
  • babadbali.com (Yayasan Bali Galang) for wewaran and paringkelan algorithm.
  • Pendit, Nyoman. (2001). "Nyepi: kebangkitan, toleransi, dan kerukunan". Jakarta : Gramedia. Retrieved at google book.
  • kalenderbali.org and kalenderbali.info for validation and building sample test-cases.