Repository navigation
docs: import process and Buffer instead of using globals - #1145
Merged
Merged
Conversation
Examples in docs and micro-utility snippets now import `process` from `node:process` and `Buffer` from `node:buffer` rather than relying on Node.js globals. Also adds a `nodeFeatureId` to `process.loadEnvFile`. Refs e18e#1144 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
i'm not sure if we should update the micro-utilities examples (in the manifest itself). those examples are meant to be used in places that want to hint at the fix rather than give an exhaustive one (e.g. npmx, maybe ESLint output, etc.). so its probably fine to leave it out there as people can infer it means @ghostdevv what do you think? |
Per review, the micro-utility examples are meant as hints for tools like npmx or ESLint output, so they keep using the globals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Makes sense, I dropped the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
Resolves #1144
📚 Description
Code examples now import Node.js built-ins explicitly instead of relying on globals, as proposed in #1144.
process: addedimport process from 'node:process'to the examples in dotenv, globby, fast-glob, resolve, is-path-in-cwd, parseargs, cli-builders and node-telegram-bot-api. Theprocess.*calls themselves are unchanged.Buffer: addedimport { Buffer } from 'node:buffer'to get-stream and stream-buffers, matching the docs that already import it.manifests/preferred.json: addednodeFeatureId(node:process/loadEnvFile) toprocess.loadEnvFile, like theBufferentries.Left as is: prose mentions of
process.cwd()etc., thenode -eone-liner inrimraf.md, and the short example snippets inmanifests/micro-utilities.json(see review discussion).🤖 Generated with Claude Code