# datenp

> Lightweight JavaScript library for nepali date conversion

Latest version **0.1.2** (published 2022-01-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install datenp
pnpm add datenp
yarn add datenp
bun add datenp
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2022-01-08 |
| First published | 2022-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 168.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | DevAndromeda |
| Maintainers | snowflake7 |
| Keywords | nepali, date, utils, nepal, bs, ad, api, english, bs-to-ad, ad-to-bs, bikram, sambat |

## Links

- npm: https://www.npmjs.com/package/datenp
- Repository: https://github.com/DevAndromeda/datenp
- Homepage: https://github.com/DevAndromeda/datenp#readme
- Issues: https://github.com/DevAndromeda/datenp/issues
- npm.io page: https://npm.io/package/datenp

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2022-01-08
- 0.1.1 — 2022-01-06
- 0.1.0 — 2022-01-06

## README

# DateNP

Lightweight JavaScript library to convert Nepali and English dates.

[![](https://data.jsdelivr.com/v1/package/npm/datenp/badge?style=rounded)](https://www.jsdelivr.com/package/npm/datenp) [![](https://img.shields.io/npm/dt/datenp.svg)](https://img.shields.io)

# Features

- Lightweight
- Zero dependencies
- Supports date conversion from `1975` BS to `2100` BS
- Easy to use
- Beginner friendly

# Installation

## Node

```sh
$ npm install datenp
```

## Deno

```ts
import DateNP from "https://deno.land/x/datenp/mod.ts";
```

## Browsers

```html
<script type="module">
import DateNP from "https://cdn.jsdelivr.net/npm/datenp@latest/dist/mod.mjs";
</script>
```

# Example

## CommonJS

```js
const { DateNP } = require("datenp");
```

## AD to BS
```js
import DateNP from "datenp"

const np = new DateNP(new Date("2022-01-06"));

console.log(np.toBS()); // { year: 2078, month: 9, day: 22 }
```

## BS to AD
```js
import DateNP from "datenp"

const np = new DateNP("2078-09-22");

console.log(np.toAD()); // { year: 2022, month: 1, day: 6 }
console.log(np.getMonthName()); // "Poush"
```

## Created and maintained by [DevAndromeda](https://github.com/DevAndromeda)
Under **MIT** License

---
_Source: https://npm.io/package/datenp · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
