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 varfoo
process.env.bar = 'blah'
sets value of env varbar
blah
delete process.env.baz
deletes environment variablebaz
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
Post a Comment