@obedm503/self

1.0.1 • Public • Published

self

Given the troubles with adding a common global reference in the spec, just use self. self already exists in browser and worker environments. This script just adds a circular reference to the already existing global in the form of self if it's not already there.

This package was inspired by @pluma's comments here and here about self being a red herring. Although self is not as pretty as global, it works.

usage

// universal js code
require('@obedm503/self');

self.console.log(self.self === self); // true

Package Sidebar

Install

npm i @obedm503/self

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

2.31 kB

Total Files

4

Last publish

Collaborators

  • obedm503