Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

feat: allow custom file name generator function #162

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mweibel
Copy link

@mweibel mweibel commented Feb 7, 2019

fixes #59

```javascript
Replay.filenameGenerator = function(request) {
// just an example, you may want to improve that
return `${slugify(`${request.method.toUpperCase()}_${request.url.path}`)}_${Date.now()}${Math.floor(Math.random() * 100000)}`;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO this should be the default, not the one with just the date time stamp

Copy link

@capaj capaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I'd just prefer the filename generator to use the path by default as shown in the example

@mweibel
Copy link
Author

mweibel commented Sep 9, 2021

@capaj thanks for replying. However meanwhile (almost 3 years ago I opened this PR ;)) I'm not using node-replay anymore.
Feel free to adjust the change you request yourself :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example for custom file name
2 participants