Skip to content

Commit

Permalink
finalized for cdn
Browse files Browse the repository at this point in the history
  • Loading branch information
santanaj committed Jul 3, 2022
1 parent 15c148f commit 5a3187f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,24 @@ This utility only takes in a newDate() format time, for example:
`new Date().toISOString()`
outputs: `2022-07-02T23:12:01.449Z` _ISO date format_

---
**CDN**:
- https://cdn.jsdelivr.net/npm/showtimeago/index.js
- https://unpkg.com/browse/showtimeago/index.js

_This essentially a common Js module so ignore error: `Uncaught ReferenceError: module is not defined
at showTimeAgo.js:115:1` via client side._

**CDN Set up:**

`<script crossorigin type="text/javascript" src="https://unpkg.com/browse/showtimeago/index.js"></script>`
```
const showTimeAgo = showtimeago
console.log(showTimeAgo(new Date()))
```

**Yarn**: https://yarnpkg.com/package/showtimeago `yarn add showtimeago`
___
#### By default `showTimeAgo` only updates on page reload

_How to show `showTimeAgo` updated time without a page reload ?_
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "showtimeago",
"version": "3.3.11",
"version": "3.3.12",
"description": "Show Time Ago is a utility that allows you to see how long ago a date was.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 5a3187f

Please sign in to comment.