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

feat: allow custom file name generator function#162

Open
mweibel wants to merge 1 commit intoassaf:masterfrom
mweibel:custom-file-name
Open

feat: allow custom file name generator function#162
mweibel wants to merge 1 commit intoassaf:masterfrom
mweibel:custom-file-name

Conversation

@mweibel
Copy link
Copy Markdown

@mweibel mweibel commented Feb 7, 2019

fixes #59

Comment thread README.md
```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
Copy Markdown

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
Copy Markdown

@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
Copy Markdown
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