You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The source code (`url-safe-string.js`) is written in vanilla JavaScript (ES5/ES6 `const`/`let` only) with zero dependencies. It was originally written in 2016 for Node 4 and the runtime code still works all the way back to Node 4+. The `engines` field is set to `>=18` because the test runner (vitest) requires it, not the module itself.
110
+
107
111
## Upgrading
108
112
109
113
### v1.x to v2.0
@@ -112,13 +116,13 @@ The API is fully backwards compatible. No code changes are needed. The major ver
112
116
113
117
**Note on transliteration:** v2.0 transliterates accented characters by default (e.g. `ö` -> `oe`). In v1.x these characters were silently stripped. This means output may differ for inputs containing accented characters -- the new output is more correct and SEO-friendly. If you need the old behavior, set `transliterate: false`.
114
118
115
-
If you are on Node.js 14 or later (released 2020), v2.0 is a drop-in replacement:
119
+
If you are on Node.js 18 or later, v2.0 is a drop-in replacement:
116
120
117
121
```bash
118
122
npm install url-safe-string@latest
119
123
```
120
124
121
-
If you need to support Node.js < 14, pin to v1.x:
125
+
If you need to support Node.js < 18, pin to v1.x:
122
126
123
127
```bash
124
128
npm install url-safe-string@1
@@ -136,9 +140,9 @@ npm install url-safe-string@1
136
140
- Added ES Module support -- `import UrlSafeString from 'url-safe-string'` now works alongside `require()`
137
141
- Added `exports` field for proper dual CJS/ESM package resolution
138
142
- Added `files` field to keep the published package minimal
139
-
- Minimum Node.js version bumped from 4 to 14
143
+
- Minimum Node.js version bumped from 4 to 18
140
144
- Switched test runner from Mocha to Vitest
141
-
- Replaced Travis CI with GitHub Actions (testing Node 14, 16, 18, 20, 22)
145
+
- Replaced Travis CI with GitHub Actions (testing Node 18, 20, 22, 24)
142
146
- Improved npm discoverability with expanded keywords and description
143
147
- Updated README with ESM/TypeScript usage examples and options table
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
"name": "url-safe-string",
3
3
"version": "2.0.0",
4
4
"engines": {
5
-
"node": ">=14"
5
+
"node": ">=18"
6
6
},
7
7
"description": "Dependency free module to convert strings into URL-safe slugs. Use for routing, SEO, permalinks, or any place you need a clean, URL-friendly string.",
0 commit comments