Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md with proper doc for cdn approach #116

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [Installation](#installation)
- [Install from npm registry](#install-from-npm-registrypreference)
- [Install from Github Packages registry](#install-from-github-packages-registryrequire-authentication)
- [Include in html page from CDN](#include-in-html-page-from-cdn)
- [Usages](#usages)
- [API References](#api-references)
- [API Documentation](#api-documentation)
Expand Down Expand Up @@ -41,6 +42,19 @@ npm install @farhan7reza7/diff-ymd-package
##### Steps to install from `Github Packages registry`:
[See steps here](https://github.com/farhan7reza7/diff-ymd-package/wiki/Github-Packages-registry-Steps)

### Include in html page from `CDN`

**`OR` for version `2.2.1` and `above`**

**Can include in page `using script tag` from CDN**

```html
<script src="https://cdn.jsdelivr.net/npm/diff-ymd-package@2.2.1/lib/index.min.js"></script>

```

[Get any supported version script tag](https://github.com/farhan7reza7/diff-ymd-package/wiki/Supported-versions-script-tags)

## Usages

### `Initialize:`
Expand All @@ -52,6 +66,15 @@ const DatesYMD = require('diff-ymd-package'); // can use any if authenticated

```

**`OR` for version `2.2.1` and `above`**

**Can include in html page `using script tag` from `CDN`**

```html
<script src="https://cdn.jsdelivr.net/npm/diff-ymd-package@2.2.1/lib/index.min.js"></script>

```

### `Create an instance:`

```javascript
Expand All @@ -72,6 +95,10 @@ const date2 = '2023-12-31';
const Formatter = DatesYMD.diffDates(date1, date2); // can use any
```

**Note:** For CDN based, only **DatesYMD** constructor name creates an instance, and can use diffDates as well, but only using global **DatesYMD** like **DatesYMD.diffDates(...)**

[See an example of using CDN based](https://github.com/farhan7reza7/diff-ymd-package/wiki/CDN-based-example)

### `Use methods to format difference:`

```javascript
Expand Down
Loading