Adobe UXP path module isn’t a module

UXP

Actually path object is classified as a global object

since UXP updated UXP 6.3.0, it can access local directory
on UXP. you may think path is a module like Node.js but after requirement, it doesn’t work well.
certainly path object is classified as a window object. but on the other hand,
you’ll notice requiring path seems to be success. what going on?

Path module exists on UXP but …

you can use methods without requiring and declaration. like below.

if you required and overwrite path object, some methods`ll be disappeared.
you may think It’s mysterious but the document mentioned it.

window.path

“The path module is registered in the global scope and can be used without declaration.”

so do not require path module. just use without any declaration.

And how about “fs” module?

fs module is classified as a module as the document mentioned.

so you can use it like Node.js including “os” module.

but they are slightly different from Node’s one. so see more details on the document.

Beer 寄付してサイトを応援する。