JavaScript theorytheory 0/50 · 0%
Node · medium

47. Node.js essentials

Scripts, environment and file access.

Node runs the same language with extra globals: `process`, `fs`, `path` and `Buffer`. Configuration comes from `process.env`, never from committed files.

const key = process.env.PRIVATE_KEY;
if (!key) throw new Error("PRIVATE_KEY missing");

Scripts that sign transactions belong on a machine you control — a leaked key is unrecoverable.

Check your understanding

  1. 1. Where should a deploy key come from?

  2. 2. Which global is Node-only?

  3. 3. What should a script do with a missing env var?