Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
antiglobal
Advanced tools
Readme
Node/browser library to detect global/window namespace pollution.
$ npm install antiglobal
$ bower install antiglobal
var antiglobal = require('antiglobal');
Take a browserified version of the library from the dist/
folder:
dist/antiglobal-X.Y.Z.js
: The uncompressed version.dist/antiglobal-X.Y.Z.min.js
: The compressed production-ready version.dist/antiglobal.js
: A copy of the uncompressed version.They all expose the global window.antiglobal
function.
<script src='antiglobal.js'></script>
<script src='js/antiglobal.js'></script>
<script src='js/foo.js'></script> // Creates window.FOO
<script>
antiglobal('FOO'); // OK, returns true
</script>
<script src='js/bar.js'></script> // Creates window.BAR
<script>
antiglobal('QWE'); // ERROR: given globals do not match real new globals
// [given: QWE | real: BAR]
</script>
antiglobal(name1, name2, ...)
functionnameN
: The name (string) of a new expected element in the global/window namespace.Returns true
if given arguments match the new elements in the global/window namespace.
It updates the list of elements in the global/window namespace for the next execution.
antiglobal.reset()
functionReset the list of elements in the global/window namespace. Useful to ignore globals introduced by a library while still allowing antiglobal()
to check other libraries loaded after that.
antiglobal.log
read/write propertyIf set to true
, errors when calling antiglobal()
are logged to console.error
.
Default value is true
.
antiglobal.throw
read/write propertyIf set to true
, errors when calling antiglobal()
throw an Error
exception.
Default value is false
.
Iñaki Baz Castillo.
ISC.
FAQs
Node/browser library to detect global/window namespace pollution
The npm package antiglobal receives a total of 7 weekly downloads. As such, antiglobal popularity was classified as not popular.
We found that antiglobal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.