Replies: 1 comment
-
Sorry about that, it should be
Sorry, I'm not following this description at all. Let me try to explain:
As a final note: you're referring to the intro blog post, but did you read through the project docs? That's really the source of truth for information about the library. There's also the README for each individual package, for example: |
Beta Was this translation helpful? Give feedback.
-
Just trying to "get through" your post at https://humanwhocodes.com/blog/2024/01/fsx-modern-filesystem-api-javascript/ and I keep stumbling over either an inconsisyernt use of the implementation / runtime naming, or a seemingly subtle difference between a runtime name and an implementatrion name,,, For example, there are several places where you use the name "fsx-node" and other spots you use "node-fsx." Please, PLEASE, either clarify when to use which, or use the same name throughout! (preferably the correct one! LOL)
As an example of my confusion, in the section introducing impl s:
Each runtime package actually exports three things:
{quote}
Each runtime package actually exports three things:
The fsx singleton
A constructor that lets you create another instance of fsx (such as NodeFsx in fsx-node)
A constructor that lets you create an impl instance for the runtime package (such as NodeFsxImpl in node-fsx)
{quote}
So, there is an impl I can create that is an abstract definition of the API and a container and factory for the underlying impl specific to the environment you asre using (node.js for example) Thus, you import fsx-node to get the pre-defined impl or to instantiate your own, either of which is accessed through the NodeFsx class, and you use that to create (factory method?) a node-fsx instance which you use by calling methods defined by the NodeFsxImpl (but we use the abstract methods oif NodeFsx when calling the contained / underlying NodeFsxImpl)
At least I think that's what you are describing - a fairly standard factory pattern? The naming is just confusing for me - node-fsx versus fsx-node...
Beta Was this translation helpful? Give feedback.
All reactions