2015-10-22 15:31:52 +08:00
|
|
|
# node
|
2014-03-05 21:37:38 +01:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
> Server-side JavaScript platform (Node.js).
|
2019-06-03 02:06:36 +02:00
|
|
|
> More information: <https://nodejs.org>.
|
2014-03-05 21:37:38 +01:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Run a JavaScript file:
|
2015-12-25 22:17:46 +00:00
|
|
|
|
2020-07-28 01:44:44 -04:00
|
|
|
`node {{path/to/file}}`
|
2015-12-25 22:17:46 +00:00
|
|
|
|
2016-02-28 21:09:02 +01:00
|
|
|
- Start a REPL (interactive shell):
|
2014-03-05 21:37:38 +01:00
|
|
|
|
|
|
|
`node`
|
|
|
|
|
2020-10-22 09:30:16 -07:00
|
|
|
- Evaluate JavaScript code by passing it as an argument:
|
2014-03-05 21:37:38 +01:00
|
|
|
|
2015-12-25 22:17:46 +00:00
|
|
|
`node -e "{{code}}"`
|
2019-01-11 00:35:23 +00:00
|
|
|
|
|
|
|
- Evaluate and print result, useful to see node's dependencies versions:
|
|
|
|
|
|
|
|
`node -p "{{process.versions}}"`
|
2020-07-22 14:33:50 -04:00
|
|
|
|
2020-07-28 17:22:23 -04:00
|
|
|
- Activate inspector, pausing execution until a debugger is connected once source code is fully parsed:
|
2020-07-22 14:33:50 -04:00
|
|
|
|
2020-07-28 01:44:44 -04:00
|
|
|
`node --no-lazy --inspect-brk {{path/to/file}}`
|