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
{{ message }}
Repository navigation
faker.system.directoryPath should have a "depth" option #3785
If no depth parameter is included, function would behave as it does today.
Alternative
No response
Additional context
This functionality would be extremely useful when generating test data for parent/child path structures. For example, if I'm generating something with a path of /x/y/z, and the structure includes a "parent" property, it would be easier to generate a value that could be used to set both if the depth of the directory structure could be set.
We marked it as "waiting for user interest" for now to gather some feedback from our community:
If you would like to see this feature be implemented, please react to the description with an up-vote (:+1:).
If you have a suggestion or want to point out some special cases that need to be considered, please leave a comment, so we are aware about them.
We would also like to hear about other community members' use cases for the feature to give us a better understanding of their potential implicit or explicit requirements.
We will start the implementation based on:
the number of votes ( 👍 ) and comments
the relevance for the ecosystem
availability of alternatives and workarounds
and the complexity of the requested feature
We do this because:
There are plenty of languages/countries out there and we would like to ensure that every method can cover all or almost all of them.
Every feature we add to faker has "costs" associated to it:
Since it is meant for internet usage anyway, we might want to add an alias to the internet module as well.
I assume there are some differences regarding (dis-)allowed characters in the url paths vs os paths.
Activity
github-actions commentedon Apr 3, 2026
Thank you for your feature proposal.
We marked it as "waiting for user interest" for now to gather some feedback from our community:
We would also like to hear about other community members' use cases for the feature to give us a better understanding of their potential implicit or explicit requirements.
We will start the implementation based on:
We do this because:
View more issues which are waiting for user interest
ST-DDT commentedon Apr 3, 2026
faker/src/modules/system/index.ts
Lines 195 to 198 in b8abfc6
Any suggestions what we should use for folder-names? Do you need absolute paths or relative paths?
matthewmayer commentedon Apr 4, 2026
If you don't care about it being "realistic" directory names you could use something like:
lriggle-strib commentedon Apr 6, 2026
@ST-DDT The work I'm doing is entirely web based, so I end up using this function to mimic url paths without the domain.
@matthewmayer That's true, I hadn't considered that. I don't need them to be realistic, so this could be an option.
ST-DDT commentedon Apr 6, 2026
Since it is meant for internet usage anyway, we might want to add an alias to the internet module as well.
I assume there are some differences regarding (dis-)allowed characters in the url paths vs os paths.
matthewmayer commentedon Apr 6, 2026
Maybe as a seperate issue it would be nice if
faker.internet.url()had the option to append a path. at the moment all generated urls are root domains.ST-DDT commentedon Apr 6, 2026
Done:
internet.urlPath-> #3790urlPathfunction to internet module #3790feat: faker.system.directoryPath depth option