Skip to content

Commit

Permalink
Dropping support for NodeJS < 14
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentpayot committed Nov 27, 2022
1 parent 0843b33 commit 0ee52f6
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Minidenticons changelog

## 2.0.0

_2022-11-27_

### Breaking change

- Dropping support for NodeJS versions below 14.0.0

### New features

- Slightly reduced custom element size

## 1.0.4

_2022-11-25_
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Alternatively, instead of `identiconSvg`, you can also import the [`identicon`](

## On NodeJS

Be sure to use a NodeJS version greater or equal to **13.2.0** to support [ES modules](https://nodejs.org/api/esm.html).
Be sure to use a NodeJS version greater or equal to **14.0.0**.

### Installation

Expand Down
3 changes: 1 addition & 2 deletions minidenticons.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ export function identicon(username, saturation=DEFAULT_SATURATION, lightness=DEF
* @type {void}
*/
export const identiconSvg =
// optional chaining only available on node 14+
globalThis.customElements && /*@__PURE__*/customElements.define('identicon-svg',
/*@__PURE__*/globalThis.customElements?.define('identicon-svg',
class extends HTMLElement {
connectedCallback() { this.identiconSvg() }
attributeChangedCallback() { this.identiconSvg() }
Expand Down
2 changes: 1 addition & 1 deletion minidenticons.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion minidenticons.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minidenticons",
"version": "1.0.4",
"version": "2.0.0",
"description": "Super lightweight SVG identicon (icon avatar) generator",
"author": "Laurent Payot",
"license": "MIT",
Expand Down Expand Up @@ -31,7 +31,7 @@
"index.d.ts"
],
"engines": {
"node": ">=13.2.0"
"node": ">=14.0.0"
},
"scripts": {
"build-js": "terser minidenticons.js --compress module=true --mangle module=true --source-map --output minidenticons.min.js",
Expand All @@ -41,7 +41,7 @@
"build": "pnpm build-js && printf '_%.0s' {1..40} && pnpm no-custom-element && pnpm --silent size && pnpm --silent size-nce",
"test": "node tests",
"benchmark": "node benchmark/node",
"prepublish": "pnpm build && pnpm test && git push && git push --tags",
"prepublish": "pnpm build && pnpm test && git push --tags",
"serve": "python3 -m http.server"
},
"devDependencies": {
Expand Down

0 comments on commit 0ee52f6

Please sign in to comment.