tldr/pages/common/node.md

25 lines
554 B
Markdown
Raw Normal View History

2015-10-22 08:31:52 +01:00
# node
2014-03-05 20:37:38 +00:00
> Server-side JavaScript platform (Node.js).
> More information: <https://nodejs.org>.
2014-03-05 20:37:38 +00:00
- Run a JavaScript file:
2015-12-25 22:17:46 +00:00
`node {{path/to/file}}`
2015-12-25 22:17:46 +00:00
2016-02-28 20:09:02 +00:00
- Start a REPL (interactive shell):
2014-03-05 20:37:38 +00:00
`node`
- Evaluate JavaScript by passing it in the command:
2014-03-05 20:37:38 +00:00
2015-12-25 22:17:46 +00:00
`node -e "{{code}}"`
- Evaluate and print result, useful to see node's dependencies versions:
`node -p "{{process.versions}}"`
2020-07-22 19:33:50 +01:00
- Enable Node's inspector agent and pause execution until a debugger is connected. Prevent delayed (lazy) parsing of source code:
2020-07-22 19:33:50 +01:00
`node --no-lazy --inspect-brk {{path/to/file}}`