Commit Graph

12 Commits

Author SHA1 Message Date
Shivam Sharma
98c85eb0dd
chore: enforce explicit Buffer import and add lint rule (#6525)
Signed-off-by: Shivam Sharma <meshivam81@gmail.com>
2025-06-27 20:10:36 -05:00
Szymon Łągiewka
41113599af fix(refactor): prefix built-in node module imports
Since v5 relies on node >= 18, this is now possible (since v16, v14.18.0
[^1][^2]).

It's functionally irrelevant:
1. It's not required for CJS nor ESM (with a few exceptions [^3])
2. It has no performance promises

However, there are upsides to this approach:
1. It brings clear boundaries to what's a built-in and what's an
external dependency
2. It reduces the risk of importing unwanted deps where a built-in is
expected
3. It's slightly more interoperable with other JS runtimes that provide
node compatibility[^4], albeit only during development. Once imported
from npm, built-ins are assumed.

[^1]:https://nodejs.org/docs/latest-v22.x/api/modules.html#built-in-modules
[^2]:https://github.com/nodejs/node/pull/37246
[^3]:https://nodejs.org/api/modules.html#built-in-modules-with-mandatory-node-prefix
[^4]:https://docs.deno.com/runtime/fundamentals/node/#using-node's-built-in-modules
2025-01-10 11:53:44 -06:00
Phillip9587
9f8589e31c cleanup: remove unnecessary require for global Buffer
The Buffer object is globally available in Node.js, so there is no need to explicitly require it.
2024-11-15 10:16:29 -06:00
Bhavya Dhiman
c70197ad33
fix(buffer): use node:buffer instead of safe-buffer (#6071)
Main Changes:
- Removed dependency `safe-buffer@5.2.1`
- Use `node:buffer` core library instead of safe-buffer
2024-10-27 11:10:33 +01:00
Wes Todd
e5feb9fcc9 Merge tag '4.20.0' into 5.0 2024-09-09 21:07:57 -05:00
Ulises Gascón
4c9ddc1c47
feat: upgrade to serve-static@0.16.0 2024-09-10 04:01:43 +02:00
Douglas Christopher Wilson
318fd4b543 Merge tag '4.17.3' 2022-02-17 00:27:11 -05:00
Douglas Christopher Wilson
a65913776d tests: use strict mode 2022-02-09 01:07:08 -05:00
Douglas Christopher Wilson
620df0e35e deps: serve-static@2.0.0-beta.1 2022-02-08 09:55:19 -05:00
Hussein Mohamed
52e9bd67b7 tests: fix typos
closes #4564
2021-07-31 16:00:16 -04:00
Douglas Christopher Wilson
88f9733ffa deps: serve-static@1.14.1 2019-05-11 19:29:33 -04:00
Douglas Christopher Wilson
6f7a8301a1 tests: add express.static test suite 2019-05-02 17:49:29 -04:00