Skip to content
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
11 changes: 11 additions & 0 deletions manifests/micro-utilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,12 @@
"description": "You can use `Object.keys` with `Array.prototype.findLast` to find the case-insensitive `PATH` environment variable key.",
"example": "const pathKey = Object.keys(process.env).findLast((k) => k.toUpperCase() === 'PATH') ?? 'PATH';"
},
"snippet::path-relative": {
"id": "snippet::path-relative",
"type": "simple",
"description": "You can use `relative` and `dirname` from `node:path` to get the relative path from one file to another.",
"example": "import { dirname, relative } from 'node:path'\n\nconst relativeFromFile = (fromFile, to) => relative(dirname(fromFile), to)"
},
"snippet::path-root": {
"id": "snippet::path-root",
"type": "simple",
Expand Down Expand Up @@ -1327,6 +1333,11 @@
"moduleName": "reduce-object",
"replacements": ["snippet::object-reduce"]
},
"relative": {
"type": "module",
"moduleName": "relative",
"replacements": ["snippet::path-relative"]
},
"repeat-element": {
"type": "module",
"moduleName": "repeat-element",
Expand Down
Loading