1.0.1 • Published 5 years ago

@obedm503/self v1.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

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