It could be installed as a library module (a dependency) for other node.js applications:
npm install kollavarsham --save
Browserify is a good tool that can generate the library to be used on the client-side (or browser) applications as well:
browserify lib/kollavarsham.js -o bundle.js
It could also be used as a cross-platform command line application (CLI) app using another CLI module (that is essentially a wrapper over the core module), when installed globally like this:
npm install -g kollavarsham
To use the library in a node.js or a browser app:
// Refer the API docs for accurate semantics var kollavarsham = require('kollavarsham'); var KollavarshamDate = require('kollavarsham').kollavarshamDate; var gregorianDate = kollavarsham.toGregorianDate(new KollavarshamDate(1184, 5, 18)); // Not implemented yet var kollavarshamDate = kollavarsham.fromGregorianDate(new Date(2014, 1, 14));
The library is still in a beta state and most of the features are working as expected (a notable exception being the ability to convert a Kollavarsham date into a Gregorian date).
The calendar for instance, is an interactive, AngularJS single page application (source) that gets the Kollavarsham dates from a RESTful service, implemented in NodeJS/ExpressJS (source), using this kollavarsham.js module.
We would like to thank Fushimi-san and Yano-san for their work on the Hindu calendar and for making it open source!
Fork us on GitHub and start contributing - kollavarsham-js repository.