Skip to content

Commit

Permalink
🐛 Use package version instead of hard-coded example
Browse files Browse the repository at this point in the history
  • Loading branch information
lewismoten committed Mar 28, 2024
1 parent b21f9e4 commit 7420e6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ yarn add @codejamboree/replace-tags
Or using a CDN (Content Delivery Network)

- jsDelivr
- Production: https://cdn.jsdelivr.net/npm/@codejamboree/replace-tags@222.333.444/dist/index.min.js
- Development: https://cdn.jsdelivr.net/npm/@codejamboree/replace-tags@222.333.444/dist-dev/index.js
- Production: https://cdn.jsdelivr.net/npm/@codejamboree/replace-tags@1.2.1/dist/index.min.js
- Development: https://cdn.jsdelivr.net/npm/@codejamboree/replace-tags@1.2.1/dist-dev/index.js
- unpkg
- Production: https://unpkg.com/@codejamboree/replace-tags@222.333.444/dist/index.min.js
- Development: https://unpkg.com/@codejamboree/replace-tags@222.333.444/dist-dev/index.js
- Production: https://unpkg.com/@codejamboree/replace-tags@1.2.1/dist/index.min.js
- Development: https://unpkg.com/@codejamboree/replace-tags@1.2.1/dist-dev/index.js

```html
<script src="https://cdn.jsdelivr.net/npm/@codejamboree/replace-tags@222.333.444/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@codejamboree/replace-tags@1.2.1/dist/index.min.js"></script>
```

## Usage
Expand Down Expand Up @@ -57,7 +57,7 @@ console.log(replacedText);
### Via CDN

```html
<script src="https://cdn.jsdelivr.net/npm/@codejamboree/replace-tags@222.333.444/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@codejamboree/replace-tags@1.2.1/dist/index.min.js"></script>
<script>
var replaceTags = window["@codejamboree/replace-tags"].replaceTags;
var text = replaceTags("Hello {{name}}!", { name: "World" });
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ VERSION=$(node -p "require('./package.json').version")
# Replace version in CDN urls
# '[email protected]' with `replace-tags@VERSION`` in README.md
# and save it to a temp file
sed -E 's/replace-tags@[0-9]+\.[0-9]+\.[0-9]+/replace-tags@222.333.444/g' README.md > temp.md
sed -E "s/replace-tags@[0-9]+\.[0-9]+\.[0-9]+/replace-tags@$VERSION/g" README.md > temp.md

# Replace README.md with the temp file
mv temp.md README.md
Expand Down

0 comments on commit 7420e6e

Please sign in to comment.