Skip to content

process.env.NODE_ENV pattern #2014

Closed
Closed
@guybedford

Description

@guybedford

Has any thought been put to the replacement for the pattern process.env.NODE_ENV === 'production' etc in Deno?

I'm trying to work out what the right alignment here will be across tools going forward in ES modules.

I guess the direct analog would be Deno.env().NODE_ENV but that is immediately permission extending for all code that does that.

import.meta could make sense for this pattern, although ideally it should just be contextual module data there.

The next best thing seems to be a global.

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions