Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notice for modern Node.js versions #30

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

Conversation

jonkoops
Copy link

Adds a notice to the README that explains to the user they might not need this module with example code that could replace the module in their project if they are targeting newer versions of Node.js.

See #29 for related discusssion.

A screenshot of the notice as it would appear in the README

README.md Outdated
Comment on lines 20 to 21
> [!NOTE]
> This module is largely a wrapper of [`http.METHODS`](https://nodejs.org/api/http.html#httpmethods) from Node.js core with backwards compatibility for Node.js versions older than 0.11.8, making it mostly unnecessary for use in new projects. For newer Node.js versions, the following code is equivalent to using this module:
Copy link
Member

Choose a reason for hiding this comment

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

In npm, it doesn't follow the same format, and the styles that GitHub applies to this type of notes wouldn't be applied

Copy link
Author

Choose a reason for hiding this comment

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

Bummer, but would that be a reason to hold it up? I believe NPM will just show this as quoted text, which seems a reasonable fallback.

Copy link
Member

Choose a reason for hiding this comment

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

Let's see if we can clarify this in the npm channel: https://openjs-foundation.slack.com/archives/CTEDKHCTB/p1729968334939499 🤔

Copy link
Member

Choose a reason for hiding this comment

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

The view on npm would look something like this

image

Copy link
Member

Choose a reason for hiding this comment

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

Doesn’t it basically say this above already? Why not reword the exist text saying what the package is for? Existing text:

This module provides an export that is just like http.METHODS from Node.js core,
with the following differences
[…] * Contains a fallback list of methods for Node.js versions that do not have a http.METHODS export (0.10 and lower).

Can we try to merge the redundancy in this description? Maybe link to the node docs instead of the code sample since you can write it at least 4 different ways nowadays depending on CommonJS, ESM, non-node prefixes?

Copy link
Member

Choose a reason for hiding this comment

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

+1 to Blake's proposal

Copy link
Author

Choose a reason for hiding this comment

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

I've revised the notice not to repeat aforementioned statements and simply instruct the user to use the core module if their support target allows, sans code example.

@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling 6f3ed49 on jonkoops:redundant-notice
into e5f5400 on jshttp:master.

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

Successfully merging this pull request may close these issues.

5 participants