Deno: Function to delete an environment variable?

Created on 24 May 2020  路  7Comments  路  Source: denoland/deno

Seems like there's no Deno.env.delete('VAR') or equivalent.

cli feat good first issue public API

Most helpful comment

This is a relatively easy feature, and it might be good for someone who is interested in exploring how deno creates bindings. Marking it as good-first-issue.

  1. The corresponding Rust API is std::env::remove_var(). Follow the example of op_set_env to create a new Op https://github.com/denoland/deno/blob/526c9196e23af34d1ecd424d09c99c7003c33844/cli/ops/os.rs#L100-L109
  2. Create a corresponding JS wrapper around that op:
    https://github.com/denoland/deno/blob/v1.0.2/cli/js/ops/os.ts#L22-L24
  3. Add type declaration and documentation here https://github.com/denoland/deno/blob/v1.0.2/cli/js/lib.deno.ns.d.ts#L112
  4. Add tests to cli/tests/unit/os_test.ts

All 7 comments

This is a relatively easy feature, and it might be good for someone who is interested in exploring how deno creates bindings. Marking it as good-first-issue.

  1. The corresponding Rust API is std::env::remove_var(). Follow the example of op_set_env to create a new Op https://github.com/denoland/deno/blob/526c9196e23af34d1ecd424d09c99c7003c33844/cli/ops/os.rs#L100-L109
  2. Create a corresponding JS wrapper around that op:
    https://github.com/denoland/deno/blob/v1.0.2/cli/js/ops/os.ts#L22-L24
  3. Add type declaration and documentation here https://github.com/denoland/deno/blob/v1.0.2/cli/js/lib.deno.ns.d.ts#L112
  4. Add tests to cli/tests/unit/os_test.ts

I'll take this one

Hi, I'm new to Deno and really want to contribute. Can I work on this one @humancalico ?

@tumile I already had a working branch but if you really want to do it go ahead. If you have any queries feel free to ask.

@tumile I already had a working branch but if you really want to do it go ahead. If you have any queries feel free to ask.

Thank you @humancalico, I just created a pull request. This is my first so inputs are very welcome.

Should this issue to be closed?

Fixed in #5859

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kyeotic picture kyeotic  路  3Comments

justjavac picture justjavac  路  3Comments

benjamingr picture benjamingr  路  3Comments

ry picture ry  路  3Comments

somombo picture somombo  路  3Comments