postmanlabs / postmanlabs/postman-code-generators

unused `fs` import on `NodeJS - Native` Code

Open
#708 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1k
Forks
381
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Unused import fs on the NodeJS - Native Code

To Reproduce

  1. Open Code </> Section for any tab/URL in postman
  2. Select NodeJS - Native on the dropdown
  3. On the second line of the generated code, fs module is imported but not used in the code

Expected code snippet and corresponding request
If you have a working code snippet that you think solves your problem, please add it here:
Also, add the request.json for which this code snippet was generated.

Screenshots
If applicable, add screenshots to help explain your problem. Please make sure the screenshot does not contain any sensitive information such as API keys or access tokens.
For example you could add the screenshot of the snippet/request builder from Postman app.

image

Additional context
If you have any reference material which might help us debug the problem please add it here:
Add any other context about the problem here.
Version of postman-code-generators/Postman app:
Postman for Mac
Version 10.14.7
UI Version 10.14.7-ui-230530-1546
Desktop Platform Version 10.14.2
Architecture arm64
OS Platform OS X 22.4.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue from the Postman Code section by selecting NodeJS - Native, then trace the NodeJS - Native generator that assembles the snippet. Confirm when the fs import is unnecessary, remove it from the generated output, and verify that the resulting request code no longer includes the unused import.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.