node.js - Is reading and writing process.env values synchronous? -


reading , writing environment variables in nodejs done using process.env object.

for instance:

  • process.env.foo evaluates env var foo
  • process.env.bar = 'blah' sets value of env var bar blah
  • delete process.env.baz deletes environment variable baz

from trial , error, , lack of callback, assume these actions synchronous, found no reference in documentation.

is env var access synchronous or asynchronous in nodejs?


addendum: why believe question non-trivial

following comments: reading , writing environment variables might mean process needs communicate operating system, or perform sort of blocking i/o operations.

therefore, makes sense ask whether environment variables stored local object in memory without synchronization, or otherwise sent operating system in blocking manner.

moreover, implementation may vary between operating systems , official documentation lacks promise non-blocking operation.

yes synchronous.

you setting , getting values of plain object.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -