4.0.0 • Published 2 years ago

revertable-globals v4.0.0

Weekly downloads
9
License
MIT
Repository
github
Last release
2 years ago

revertable-globals

Sets globals in a JavaScript environment that can be easily reverted to restore the original environment; useful for testing code that relies on the presence of certain globals.

Installation

For Node.js, to install revertable-globals with npm, run:

npm install revertable-globals --save-dev

For Deno, an example import map:

{
  "imports": {
    "revertable-globals": "https://unpkg.com/revertable-globals@4.0.0/revertableGlobals.mjs"
  }
}

Then, import and use the function revertableGlobals.

Requirements

Supported runtime environments:

  • Node.js versions ^14.17.0 || ^16.0.0 || >= 18.0.0.
  • Deno.

Non Deno projects must configure TypeScript to use types from the ECMAScript modules that have a // @ts-check comment:

Exports

The npm package revertable-globals features optimal JavaScript module design. These ECMAScript modules are exported via the package.json field exports:

4.0.0

2 years ago

3.0.0

2 years ago

2.0.0

3 years ago

1.1.0

3 years ago

1.0.1

4 years ago

1.0.0

4 years ago