Commit Graph

64 Commits

Author SHA1 Message Date
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
Douglas Christopher Wilson
20047bb6e4 examples: use strict mode 2022-02-02 01:30:51 -05:00
Aditya Srivastava
3f1dcb96e0 examples: add viewport and charset where missing
closes #3860
2020-03-25 17:10:34 -04:00
Alvin Smith
02f3933b69 examples: minor fixes to some examples
closes #3812
2018-12-17 23:00:19 -05:00
Douglas Christopher Wilson
c0136d8b48 Add express.json and express.urlencoded to parse bodies
closes #2211
2017-09-28 13:22:36 -04:00
Douglas Christopher Wilson
56e90e3c72 lint: add eslint rules that cover editorconfig 2017-08-05 23:37:39 -04:00
Jamie Barton
3763d73a1f examples: replace jade with hbs in mvc example
fixes #3181
closes #3185
closes #3243
closes #3245
closes #3249
2017-03-23 00:45:23 -04:00
chainhelen
8eb95ae579 examples: use path.join instead of concatenation
closes #3236
2017-03-05 23:07:24 -05:00
Douglas Christopher Wilson
6b506d801a examples: fix mvc example to ignore files in controllers dir
fixes #3182
2017-01-26 22:33:52 -05:00
Dmitriy
24fce9deb3 examples: fixes to mvc example
closes #2534
2015-02-18 23:03:24 -05:00
Douglas Christopher Wilson
4aa2801054 Merge tag '3.18.6' 2014-12-12 22:06:21 -05:00
Douglas Christopher Wilson
d23417e6e8 examples: switch examples used in tests to ejs engine 2014-11-29 12:09:00 -05:00
Douglas Christopher Wilson
ca306eace1 deps: update example dependencies 2014-07-03 10:49:53 -04:00
Douglas Christopher Wilson
7d6208e0af deps: connect@2.21.0 2014-06-21 21:09:10 -04:00
Douglas Christopher Wilson
6ee9433f29 deps: update example dependencies 2014-06-20 16:43:04 -04:00
Douglas Christopher Wilson
5a4e9125de deps: connect@2.20.2 2014-06-19 23:24:07 -04:00
Douglas Christopher Wilson
4279e6ef45 improve before hook in mvc example 2014-06-06 10:42:29 -04:00
Douglas Christopher Wilson
9e5a758e7c deps: update example dependencies 2014-06-02 20:59:45 -04:00
Douglas Christopher Wilson
db4448dda8 Merge tag '3.9.0' 2014-05-30 22:17:51 -04:00
Douglas Christopher Wilson
c18c2a8e68 tests: exclude untestable lines in examples from coverage 2014-05-28 00:07:27 -04:00
Douglas Christopher Wilson
602e5a8200 tests: add more tests of mvc example 2014-05-20 23:41:09 -04:00
Fernando Silveira
ce17efd95b MVC example: EJS -> Jade. 2014-04-23 00:13:26 -03:00
Fernando Silveira
b38ffd7376 Fixing bug in MVC example pet view. 2014-04-22 23:30:17 -03:00
Fernando Silveira
896609c859 Fixing bug when updating pet name in MVC example. 2014-04-21 12:10:21 -03:00
Fernando Silveira
50158b851c Express 4 now uses "method-override" external library. 2014-04-21 12:08:34 -03:00
agchou
06dcb22ae2 clean up code consistency 2014-03-27 09:15:27 -07:00
Roman Shtylman
1396e0855d remove last pieces of connect dependency
- copy over patch.js to shim ServerResponse
- bundle `static` middleware
2014-02-22 09:26:29 -05:00
Patrick Williams
91835e6816 Flush messages exposed to locals after the view has the chance to process them. 2013-05-10 09:05:37 -06:00
Jan Buschtöns
73ce9d028c Line 40 removed. Fixed! 2012-07-26 21:46:22 +02:00
TJ Holowaychuk
ab61837885 change res.sendfile() to use send() module 2012-07-13 08:58:40 -07:00
TJ Holowaychuk
cc84f40d61 misc 2012-04-26 04:46:37 -07:00
TJ Holowaychuk
30167356f2 less verbose example apps when testing 2012-04-26 04:40:04 -07:00
TJ Holowaychuk
50f43462ae logger for mvc 2012-04-26 04:32:25 -07:00
TJ Holowaychuk
bd2a972dba fixed mvc example 404 2012-04-26 04:28:29 -07:00
TJ Holowaychuk
3c162ae030 implement "before" middleware for mvc example 2012-04-26 04:23:21 -07:00
TJ Holowaychuk
fa746cc027 added 404 and 5xx pages to mvc example 2012-04-26 04:08:58 -07:00
TJ Holowaychuk
1e85178c73 started mvc acceptance tests 2012-04-26 04:02:14 -07:00
TJ Holowaychuk
d0bc0ad2ca Added new mvc example 2012-04-26 03:53:49 -07:00
TJ Holowaychuk
cc69d50c60 remove mvc example
too large to actually be helpful... and annoying
to maintain :)
2012-04-17 20:37:55 -07:00
Tj Holowaychuk
297ae6fdb4 removed use of app.error() in examples 2011-07-14 12:59:13 -07:00
Tj Holowaychuk
0634bf0b0d fixed redis example 2011-05-20 09:38:52 -07:00
Tj Holowaychuk
573f940985 fixed example hasMessages
sessions are not always available
2011-04-08 12:44:03 -07:00
Tj Holowaychuk
d39293c025 refactor 2011-04-08 12:36:26 -07:00
Tj Holowaychuk
2a7a5aeefe Renaming usage of old connect middleware 2011-03-01 10:59:09 -08:00
Tj Holowaychuk
7687299275 Added secret to session middleware used in examples and generated app 2011-01-29 12:36:48 -08:00
Tj Holowaychuk
2662dae560 Removed "_" prefix from partials 2010-12-10 10:18:38 -08:00
Tj Holowaychuk
8d3296fb1b Fixed mvc example due to view lookup changes 2010-12-05 10:02:38 -08:00
Tj Holowaychuk
6f2120bb59 Fixed mvc example 2010-11-25 14:05:28 -08:00
Tj Holowaychuk
70102aecb5 Fixed mvc example 2010-10-07 04:15:34 -07:00
Tj Holowaychuk
ebdf6434eb Fixing up examples a bit 2010-10-05 06:14:19 -07:00